Generated Output

There is a class of transformations that are not achievable using literal result elements. For example, if the local name or namespace URI of an element or attribute needs to be calculated based on XSLT processing, a literal result element cannot be used. Conditional emission of attributes is also complicated when using literal result elements. Additionally, any processing instructions or comments that appear in templates are stripped away during processing.

XSLT defines four instructions that can be used to algorithmically generate specific output nodes: xsl:comment, xsl:processing-instruction, xsl:element, and xsl:attribute. These instructions can be used in place of literal result elements, and because they make extensive ...

Get Essential XML: Beyond Markup 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.