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>
               

            

XML Videos

Stylus Studio online XML video demonstrations illustrate how easy it is to learn advanced XML editing techniques. Now playing: Java Code Generation, Convert to XML, Grid View, and many other informative video demonstrations.

XML File Explorer

The XML File Explorer provides a productive, consistent, and easy-to-use interface for working with any data sources (relational data, EDI, binary, XML, CSV, and more) used in enterprise data integration projects.

Translating X12 Documents to XML

The X12 to XML Converter is a built-in function of the adapter library. The XML that is generated is well commented and indented, and can be used anywhere XML is normally used — with XML Schemas, XSLT, XQuery, etc.

Using Relational Data in XML Applications

"Using Relational Data in XML Applications" By Dr. Michael Kay covers an overview of several common use cases and provides insight into the benefits and drawbacks of using the approaches available today including XQuery and SQL/XML.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member