January 2003
Beginner to intermediate
1200 pages
23h 42m
English
So far, the templates in this chapter have been fairly rigid skeletons, specifying exactly what should go into the output document, in what order. But you can use XSLT elements such as <xsl:element>, <xsl:attribute>, <xsl:text>, and so on to create new nodes on the fly, based on what you find in the input document. I'll take a look at how this works now.
Say that you wanted to convert the text in some elements to attributes in other elements; how could you do it? Attribute values must be quoted in XML, but you can't just use expressions like these, where I'm taking the values of <NAME>, <MASS>, and <DAY> elements and trying to make them into attribute values:
<xsl:template ...