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>

An Introduction To XML Schema Development

An Introduction to XML schema development in Stylus Studio covers some of the highlights of our XML Schema Editor, powerful tools for editing, validating, converting and generating XML schema. Watch the video online today!

Java Code Generation

The Stylus Studio Java Codce Generator lets you generate deployable Java code for XQuery and XSLT at the push of a button!

Web Service Testing Tools

The Stylus Studio Web Service Tester allows you to easily locate, build references to, and test Web services for XML applications based on WSDL, SOAP, and UDDI standard Web service technologies.

XML-DEV Discussion Forum

XML-DEV is a leading technical forum for XML discussion and a valuable free XML learning resource. Subscribe to the XML-DEV email discussion forum today to help further your XML education.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member