Filter XML based on another xml using XSLT 1

后端 未结 3 1625
耶瑟儿~
耶瑟儿~ 2021-01-01 08:01

How do we filter an xml document based on another xml document. I have to remove all the elements which are not there in the lookup xml. Both the input xml and lookup xml ha

3条回答
  •  攒了一身酷
    2021-01-01 08:51

    Based on what I've done in the past when faced with similar problems I'd suggest:

    • Write a transformation in XSLT to which consumed the "filter XML" and produce a transformation (also in XSLT).
    • Run the resulting XSLT on your input.

    It sounds (and is) ugly, but I've found this easier than trying to interpret the filter description on the fly while transforming the input.

提交回复
热议问题