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>

Validate XML Using XSD

You can validate XML documents against any data model defined using W3C XSD, using any major XSD Validator, including MSXML 3.0, MSXML 4.0, MSXML 6.0, Xerces-J, Xerces-C, Microsoft System.XML (1.0 and 2.0), XSV, the Saxonica XSD Validator and others.

WSDL Editor

WSDL Editor featuring a graphical WSDL viewer, syntax help, Java Web Service code generation and more. Simplify Web Services development with Stylus Studio's Web Service Description Language (WSDL) Editor today!

Developer Resource Center: Learn XML and Stylus Studio

Learning XML is easy with Stylus Studio. Check out our free XML tutorials, XML whitepapers, online video demonstrations, XML examples and XML references and more.

Mail, Package & Freight Delivery

Want to know what mail, package & freight delivery companies are shipping away there XML woes? Now you can! Check out these top mail, package & freight delivery companies that are packaged with the power of Stylus Studio.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member