<root> <cat> <id>0</id> <value>white</value> <details>...</details> </cat> <cat> <id>1</id> <value>black</value> <details>...</details> </cat> </root>
<root> <cat> <id>0</id> <value>white</value> </cat> <cat> <id>1</id> <value>black</value> </cat> </root>
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <root> <xsl:for-each select="/root/cat"> <cat> <id><xsl:value-of select="./id" /></id> <value><xsl:value-of select="./value" /></value> </cat> </xsl:for-each> </root> </xsl:template> </xsl:stylesheet>
Jump To Top of Thread