December 2002
Intermediate to advanced
576 pages
32h
English
<xsl:attribute>
This adds an attribute with the given name to an element in the
result tree. Only one attribute with a particular name can be added
to a specific element. The contents of the
<xsl:attribute> element form the value of
the attribute:
<xsl:element name="book"> <xsl:attribute name="title">Moby Dick</xsl:attribute> <xsl:text>This is about a whale</xsl:text> </xsl:element>
This creates the following element in the result tree:
<book title="Moby Dick">This is about a whale</book>
The optional namespace attribute specifies a
namespace for the new attribute.
<xsl:attribute name="name" [namespace="namespace"]> ... </xsl:attribute>
Read now
Unlock full access