1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:key name="regrouper" match="a" use="."/>
<xsl:template match="/">
<r>
<xsl:apply-templates select="r/t/a[generate-id(.)=generate-id(key('regrouper',.)[1])]"/>
</r>
</xsl:template>
<xsl:template match="a">
<t>
<xsl:copy-of select="."/>
<xsl:apply-templates select="//b[../a=current()]"/>
</t>
</xsl:template>
<xsl:template match="b">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet> |
Partager