Home Tutorial Xml XSLT Elements and Attributes

 
 

XSLT Elements and Attributes
Posted on: November 26, 2010 at 12:00 AM
Advertisement
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>


Advertisement

Related Tags for XSLT Elements and Attributes:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 26, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com