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 are the components of xml?
How do I view an xml file?
How do I display an rss feed on my website?
What is a Processing Instruction in XML?
Do xml namespace declarations apply to dtds?
What is mean by xsl?
How many document types are defined for atom feed files?
What are the three main characteristics of xml?
Write a program that shows the elements of the stylesheets?
What is dtd ( document type definition )?
Why XML editor is needed instead of Notepad?
Use of CSS in XML document?
How do I find rss feeds?
What are the differences between HTML and XML?
What is xsl used for?