Re: [xsl] xsl:include blues..

Subject: Re: [xsl] xsl:include blues..
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 13 Feb 2001 11:19:42 GMT
> I am not sure why the above doesn't work, but I assume its because the
> templates must be well-formed? So the question is, how can I include the
> same "header" and "footer" 

Yes, that is one way to phrase it but another is to say that XSLT does
not deal with the string representation of an XML file, but with a tree
representation. 

You say you want to have <html> added at one place and </html> added
somewhere else, but that is talking about characters in the string
that represents the XML document.

If you think in terms of the node tree you'll see that there is just one
item, the HTML element node, so it can only be added at one place.
The template that adds the html node can then call a named template that
adds a body element node (and all its children) that has been included
from your xsl:include file.

You could do the same with a footer, but if your "footer" is </body></html>
then that isn't a footer at all that syntax will be generated when the
result tree is serialised as the html and body nodes were added to the
result tree by your initial template.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread