apply-templates select="@*|node()



I am very new to xslt. Please help me in understand how will the flow of below xslt work for a given xml


Will the output be same as the input or will the output consist of only attributes.



<xsl:template match="/">

<Request>
<xsl:apply-templates select="Envelope/body/*" />
</Request>
</xsl:template>

<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>

<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>


Thanks


No comments:

Post a Comment