This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSLT merging XML documents
- To: xsl-list at mulberrytech dot com
- Subject: Re: XSLT merging XML documents
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Wed, 26 Jul 2000 13:20:26 +0200 (MET DST)
- Reply-To: xsl-list at mulberrytech dot com
> I had this problem too, I'm still fairly new but found that putting quotes
> around the forward slash in the calls to the document function works
>
> document($file1,'/')/node()
> document($file2,'/')/node()
> document($with,'/')/node()
But that doesn't reflect the intended behaviour.
Using >>/<< means the root node of the input document.
Using >>'/'<< means the string '/'.
If stylesheet and XML source are at the same location (e.g. directory),
you can omit the second parameter at all.
A problem arises if the stylesheet is in another directory. In this
case the XSLT processor looks for $file1 in the stylesheet directory.
Strictly spoken: it uses the base URI of the stylesheet, whereas you
want the base URI of the input file to be applied.
For this purpose you provide a node with the wanted base URI, for
example the root node. Changing >>/<< to >>/*<< gives the toplevel
element node and works as well.
Regards,
Oliver
BTW: I'll put a new version during the day on my web page [1].
There's a bug contained which causes xt to fail (I didn't
know why so far ...). The new version of Saxon (5.4) behaves
like xt in this respect - that perplexed me a little bit ...
[1] http://www.informatik.hu-berlin.de/~obecker/XSLT/#merge
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list