[Solved] Merge different products belong to each standard – V2 [duplicate]
This XSLT will do the thing: <xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:x=”http://ws.wso2.org/dataservice” xmlns=”http://ws.wso2.org/dataservice” exclude-result-prefixes=”x” version=”1.0″> <xsl:output indent=”yes” method=”xml” /> <xsl:template match=”x:Standards”> <Standards namespace=”{namespace-uri()}”> <xsl:apply-templates select=”.//x:Standard” /> </Standards> </xsl:template> <xsl:template match=”x:Standard”> <Standard> <xsl:copy-of select=”x:ProductID” /> <xsl:copy-of select=”x:Prefix”/> <xsl:copy-of select=”x:SNumber”/> <RelatedProducts> <xsl:apply-templates select=”.//x:RelatedProduct”/> </RelatedProducts> <xsl:copy-of select=”x:S1″/> <xsl:copy-of select=”x:S2″/> </Standard> </xsl:template> <xsl:template match=”x:RelatedProduct”> <xsl:element name=”RelatedProduct”> <xsl:element name=”RelationType”> <xsl:value-of select=”name(..)” /> </xsl:element> … Read more