Using XSLT, how would you extract a specific attribute from an element in an XML document?
4142
18-Mar-2011
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.