Specifying output attributes in XSL
Motivating example Suppose you have this XML document: fred tom
Motivating example Suppose you have this XML document: fred tom Now, suppose you want to generate this: People fred tom
A first effort Source document: fred tom Intended output People fred tom A tentative XSL file <xsl:transform version="1.0" xmlns:xsl=" People ’ >
This approach will not work
Using the xsl:attribute element in xsl2.xsl People
This works
You can do this for any attribute People alert('hello'); People
After the page is loaded
When the mouse is held over the h1 heading
xsl:attribute elements must come first This will not work –Because the xsl:attribute is not first People People alert('hello');
Alternative approach, using escape braces People '>