Recursively combine identical sibling elements in XSLT

前端 未结 3 596
你的背包
你的背包 2020-12-18 08:52

How can I merge all sibling elements with the same name and the same attributes into a single element using XSLT? The transformation should also be applied recursively to c

3条回答
  •  甜味超标
    2020-12-18 09:36

    If you are using XSLT2 you should be able to use the grouping facility. Here is an early tutorial:

    http://www.xml.com/pub/a/2003/11/05/tr.html
    

    Here is a later one written by a group who produces excellent tutorials:

    http://www.zvon.org/xxl/XSL-Ref/Tutorials/index.html
    

    If you are restricted to XSLT1 it's possible but harder.

    If you are still stuck try Dave Pawson's FAQ: http://www.dpawson.co.uk/xsl/sect2/N4486.html

提交回复
热议问题