Using XSLT, how would you extract a specific attribute from
an element in an XML document?
Answer Posted / guest
Successful candidates should recognize this as one of the
most basic applications of XSLT. If they are not able to
construct a reply similar to the example below, they should
at least be able to identify the components necessary for
this operation: 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.
Extract Attributes from XML Data
Example 1.
<xsl:template match="element-name">
Attribute Value:
<xsl:value-of select="@attribute"/>
<xsl:apply-templates/>
</xsl:template>
Is This Answer Correct ? | 11 Yes | 6 No |
Post New Answer View All Answers
What is cdata in xml?
Do you feel that you are a good xslt programmer? : xslt
Define complex element?
how to transform an XML file into HTML using XSL transformation (XSLT)?
Can you use the xslt to convert html into vxml? : xslt
How does xml handle white-space in my documents?
What is the difference between a podcast and a rss?
Is xml schema required?
What is xml document?
What is an xml instance?
How do I save a xml file?
Why xml is needed?
Explain the classes in System.XML Namespace?
What language does xml use?
How many types of dtd are there in xml?