Using XSLT, how would you extract a specific attribute from an element in an XML document?
Submitted by: AdministratorSuccessful 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>
Submitted by: Administrator
Extract Attributes from XML Data
Example 1.
<xsl:template match="element-name">
Attribute Value:
<xsl:value-of select="@attribute"/>
<xsl:apply-templates/>
</xsl:template>
Submitted by: Administrator
Read Online XML Job Interview Questions And Answers
Top XML Questions
☺ | Using XSLT, how would you extract a specific attribute from an element in an XML document? |
☺ | Give some examples of XML DTDs or schemas that you have worked with? |
☺ | When constructing an XML DTD, how do you create an external entity reference in an attribute value? |
☺ | Why is XML such an important development? |
☺ | Describe the role that XSL can play when dynamically generating HTML pages from a relational database? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |