Chapter 6. Building New XML Documents with XSLT

  • Creating new XML elements

  • <xsl:element>

  • <xsl:attribute>

  • Literal result elements (LREs)

  • Attribute value templates (AVTs)

  • <xsl:processing-instruction>

  • <xsl:comment>

  • <xsl:namespace-alias>

One of the most convenient features of XSLT stylesheets is the ability to generate new content in the process of transformation. This generated content can be derived through a series of XPath expressions in combination with LREs, text that you add, or with other elements in XSLT yet to be introduced.

There are many ways to work with the existing structure and content of an XML document. However, there are only a few specific XSLT elements that deal directly with the creation of new elements and content. In this chapter, ...

Get XSLT and XPATH: A Guide to XML Transformations now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.