Nodes

xsl:value-of

<xsl:value-of select="element_name" [disable-output-escaping="<yes,no>"]/>
  • Gets the value of a node
  • Outputs the text value of the element as well as any child elements
  • To output only the text value of the element (and not the child elements) use text() for the select attribute
  • The value of the select attribute is an XPath expression
  • If the select attribute matches more than one element, only the first element will be outputted

xsl:copy

<xsl:copy>...</xsl:copy>
  • Shallow copy
  • Copies the (current) context node (without attributes or child nodes)

xsl:copy-of

<xsl:copy-of select="expr"/>
  • Deep copy
  • Copies all attributes and descendant nodes for the specified node(s)
<!-- Identity template -->
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>

xsl:attribute

<xsl:attribute name="name">...</xsl:attribute>
  • Adds an attribute
<xsl:attribute name="name">
<xsl:value-of select="..." />
</xsl:attribute>