入力 XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<section name="foo" p="Hello from section foo" q="f" w="fo1"/>
<section name="foo" p="Hello from section foo1" q="f1" w="fo1"/>
<section name="bar" p="Hello from section bar" q="b" w="ba1"/>
<section name="bar" p="Hello from section bar1" q="b1" w="ba1"/>
</document>
予想される出力 XML:
<document>
<section name="foo" w= "fo1">
<contain p="Hello from section foo" q="f" />
<contain p="Hello from section foo1" q="f1" />
</section>
<section name="bar" w= "ba1">
<contain p="Hello from section bar" q="b" />
<contain p="Hello from section bar1" q="b1" />
</section>
</document>
私のアプリケーションは XSLT 1.0 しか使用できないため、xsl:for-each-group
.