Re: [xsl] How to use document() of doc() function with copy idiom, or how to access nodes of doc() tree

Subject: Re: [xsl] How to use document() of doc() function with copy idiom, or how to access nodes of doc() tree
From: Abel Braaksma Online <abel.online@xxxxxxxxx>
Date: Tue, 25 Jul 2006 17:02:49 +0200
Thanks Michael, for pointing that out. This "initial template" thing is nice and looks much better than using itself as input.
Thanks Colin, for your extra explanation on "initial template". I'm all up to grips again!


I indeed overlooked this "value-of". I should've known better ;)

Cheers,
Abel

Michael Kay wrote:

Your problem seems to be very simple:

<xsl:value-of select="document($input-file)" />

The xsl:value-of instruction writes a text node whose value is the
string-value of the input. The string value of a document node is the
concatenation of all its text, with no hierarchic structure. You probably
want xsl:copy-of or xsl:sequence.

Note also: XSLT 2.0 does allow you to run a stylesheet with no principal
input document. Just specify a named template as the entry point. If using
the Saxon command line you do this with the "it" option, e.g. "-it main".

Michael Kay
http://www.saxonica.com/

Current Thread