XSLT TutorialLesson 56Free preview
XSLT <value-of>
This lesson is part of XML · All levels
Summary
<xsl:value-of> is an XSLT element that takes the value of a string from an XML node and writes it to the transformation output. The expression on the select attribute determines which node is selected; for the node-sets, the values taken are the string-values of the first node only. These elements are almost always used with <xsl:for-each> or <xsl:apply-templates> when you want to display a lot of data.
Key points
- <xsl:value-of select="..."> write string-values of the resulting node
- For sets of nodes containing many nodes, only the first node is taken to be worth
- The elements generate the entire text in it, including text from the child element
- Attributes are accessed with the @ sign, for example select="@price"
- The built-in output is plain text, not XML fragments.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.