şu xml için
kod bozuksa şurdan alı ver http://pastebin.com/x83m7T0a
<root>
<record>
<key>1</key>
<movie>Leon</movie>
</record>
<record>
<key>1</key>
<movie>Godfather</movie>
</record>
<record>
<key>2</key>
<movie>Hangover</movie>
</record>
</root>
şu xslt iş görür
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="movies-by-key" match="record" use="key" />
<xsl:template match="root">
<root>
<xsl:for-each select="record[count(. | key('movies-by-key', key)[1]) = 1]">
<record>
<key>
<xsl:value-of select="key" />
</key>
<movies>
<xsl:for-each select="key('movies-by-key', key)">
<movie>
<xsl:value-of select="movie" />
</movie>
</xsl:for-each>
</movies>
</record>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
N/A
|