July 2001
Intermediate to advanced
592 pages
11h 16m
English
Attributes can be added to LREs in three ways: by directly typing the attribute and its value in the LRE, by using the <xsl:attribute> element, or by using the <xsl:attribute-set> element in conjunction with either the use-attribute-sets on an element or xsl:use-attribute-sets attribute on an LRE. Because LREs are passed through to the output result tree, using attributes directly in LRE elements can be difficult if the value of the attribute is to be generated or extracted from some node-set in the input document. For example, if we wanted to output a new element called <newblock> instead of our <block>s in Markup City, and then add an attribute with the text content of the <block>, the template in Example 6-14 ...