[Solved] Sibling as Child

In XSLT 2.0, you could have probably made use of xsl:for-each-group, using its group-starting-with attribute. In XSLT 1.0 though, this can be achieved by use of keys. You can define a key to look up the Loop-2000B elements by their first preceding Loop-2000A element <xsl:key name=”B” match=”ex:Loop-2000B” use=”generate-id(preceding-sibling::ex:Loop-2000A[1])” /> Similarlym you could do the same … Read more

[Solved] How to apply XSLT transformations to XML file and produce another XML?

The following XSLT does what you need (except formatting): <?xml version=”1.0″ encoding=”utf-8″?> <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:msxsl=”urn:schemas-microsoft-com:xslt” exclude-result-prefixes=”msxsl” > <xsl:output method=”xml” indent=”yes” encoding=”iso-8859-1″/> <!– Copy all elements recursively –> <xsl:template match=”@* | node()”> <xsl:copy> <xsl:apply-templates select=”@* | node()”/> </xsl:copy> </xsl:template> <!– Copy this element with subelements –> <xsl:template match=”order”> <!– Save ID for queries –> <xsl:variable … Read more