RE: template name in attributes
i have the xml:
This much is kosher.
<xsl:template match="quicksearch"> ... </xsl:template>
This, however, doesn't work as expected because the value of the match attribute should [usually] be the name of the matched element or attribute, not their values. Thus, it would something like:
match="@name[. = 'quicksearch']"
The "usually" above is because it's possible to match using non name-specific expressions: node() to match any node, text() for text nodes, @* for attributes, etc.
So now we know why the template doesn't fire. The "value of the attribute" is being output because XSLT has default, behind-the-scenes templates that automatically output certain nodes, if not overridden. Thus, if you left things as they were, then add the following template, you wouldn't get even the attribute value output:
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format