April 2001
Intermediate to advanced
112 pages
2h 15m
English
<xsl:attribute>
<xsl:attribute name=”name" [namespace=”namespace"]> ... </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.
Read now
Unlock full access