Altering Document Structure Based on Input

Altering Document Structure Based on Input

So far, the templates Ive created have been based on somewhat rigid skeletons, specifying exactly what should go into the output document, and 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.

Youve already had a little experience in this area, because I used attribute value templates in Chapter 3. As you recall, you can use attribute value templates to set an attribute to the value of an XPath expression, if you enclose that expression in curly braces, { and }. For example, to set the NAME attribute to the string value of a <DESCRIPTION> element that is a child of the context node, you could assign that value like this: NAME={DESCRIPTION} . However, now its time to dig deeper into the whole topic of creating new elements and attributes on the fly, starting with <xsl:element> .



Inside XSLT
Inside Xslt
ISBN: B0031W8M4K
EAN: N/A
Year: 2005
Pages: 196

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net