Home Tutorial Xml XSLT Elements and Attributes

 
 

XSLT Elements and Attributes
Posted on: November 26, 2010 at 12:00 AM
The element is used to create an output element with the specified name and it specifies that an element is for output. It's name attribute specifies the name of the element. The elements can be nested.

Elements and Attributes

The element is used to create an output element with the specified name and it specifies that an element is for output. It's name attribute specifies the name of the element. The elements can be nested.

For example:

<xsl:element name="elms">
      <xsl:element name="elm">hi</xsl:element>     
</xsl:element>

Like xsl:element element, the xsl:attribute element is used to output an attribute.

<elm>
   <xsl:attribute name="attr">
        <xsl:value-of select="one"/>
        <xsl:text> </xsl:text>
        <xsl:value-of select="two"/>
   </xsl:attribute>
   hi
</elm>

You can also use curly brackets instead of using attributes. Using curly brackets is simpler than using attributes and easy to write also.

<elm attr="{one} {two}">hi</elm>


Related Tags for XSLT Elements and Attributes:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.