xsl-list
[Top] [All Lists]

RE: Re: [xsl] Use document() function to get a reference to the input doc

2006-07-17 15:49:51
Thanks to everyone who replied. Perhaps if I'd been looking for the correct 
construct I would have found it in my files.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     andrew welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>
Sent:     Mon, 17 Jul 2006 22:58:04 +0100
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  Re: [xsl] Use document() function to get a reference to the input doc

On 7/17/06, cknell(_at_)onebox(_dot_)com <cknell(_at_)onebox(_dot_)com> wrote:
I know I must have done this a hundred times, but I just can't find any 
example on my computer at this moment. Please straighten me out.

I wish to use the document() function to create a variable holding the input 
document. My stylesheet contains this element:

<xsl:variable name="main-doc" select="document('/')" />

When I run the transform, Saxon complains that I may not have any content in 
the prologue. I know this is a huge clue as to what I've done wrong, but I 
just can't see it. What have I done wrong and how do I fix it?

I've had this error when the input doc is empty, or when a BOM has
crept after the source has been saved using Notepad (although that was
specific to a certain XML parser, which I can't remember).  I guess
you could always use select="document(base-uri(/))"

What is the reason for using select="document(...)" instead of just select="/" ?

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • RE: Re: [xsl] Use document() function to get a reference to the input doc, cknell <=