Extract Attributes from XML Data Example: <xsl:template match=”element-name”> Attribute Value: <xsl:value-of select=”@attribute”/> <xsl:apply-templates/>
</xsl:template>
Note:xsl:template to match the appropriate XML element, xsl:value-of to select the attribute value, and the optional xsl:apply-templates to continue processing the document.
Liked By
Write Answer
Using XSLT, how would you extract a specific attribute from an element in an XML document?
Join MindStick Community
You have need login or register for voting of answers or question.
Dependra Pathak
18-Mar-2011Extract Attributes from XML Data
Example:
<xsl:template match=”element-name”>
Attribute Value:
<xsl:value-of select=”@attribute”/>
<xsl:apply-templates/>
</xsl:template>
Note:xsl:template to match the appropriate XML element,
xsl:value-of to select the attribute value, and the optional
xsl:apply-templates to continue processing the document.