USING XSLT, HOW WOULD YOU EXTRACT A SPECIFIC ATTRIBUTE FROM AN ELEMENT IN AN XML DOCUMENT?

Dependra Pathak

Total Post:77

Points:385
Posted by  Dependra Pathak
XML 
XML
 1679  View(s)
Ratings:
Rate this:
  1. Dependra Pathak

    Post:77

    Points:385
    Using XSLT, how would you extract a specific attribute from an element in an XML document?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!