xsl:element

Adds an element to the result tree.

Format

<xsl:element name="qualified_name">
               
  element_contents
               
</xsl:element>
               

            

Description

The XSLT processor uses the contents of the xsl:element instruction as a template for the attributes and contents of the new element.

The prefix part of the name attribute becomes the prefix for the element you are creating. The local part of the name attribute becomes the local name of the element you are creating.

The XSLT processor interprets the name attribute as an attribute value template. The string that results from instantiating the attribute value template must be a qualified name. If it is not, the XSLT processor reports an error.

Example

<xsl:element name="audio:CD">
               
  <xsl:element name="audio:title">Celtic Airs</xsl:element>
               
  <xsl:element name="audio:artist">Chieftains</xsl:element>
               
</xsl:element>
               

            

The result of this instruction looks like the following:

<audio:CD>
               
  <audio:title>Celtic Airs</audio:title>
               
  <audio:artist>Chieftains</audio:artist>
               
</audio:CD>
               

            

XSLT Editor

Stylus Studio's XSLT Editor is the most advanced XSLT development tool on the market. This powerful tool provides backmapping, XSLT transformation preview, debugging, peformance profiling, and more!

Using Stylus Studio with RenderX XEP

RenderX XEP is a production-quality engine that converts XSL:FO into PDF or PostScript files. You can use RenderX XEP in place of the Apache FOP engine to render PDF files from Stylus Studio.

XSL-List Blog

XSL-List is a discussion forum on the Extensible Stylesheet Language (XSL), covering the XSL specification, XSL processors, tools, user questions, trends and more. Bookmark this RSS or ATOM feed now!

OASIS Catalog Support

Stylus Studio's features for working with OASIS catalogs allow you to incorporate any vendor's catalog - or one of your own - in your XML, making writing correct and robust XML easier than ever.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member