This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: document() to get root node of xml file???
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 13 Feb 2002 09:25:37 +0100
- Subject: Re: [xsl] document() to get root node of xml file???
- References: <DCEPIHHFOCEMDBGBKIOPIEMHCDAA.bry@itnisk.com> <3C6A0D6F.5000205@yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
<xsl:variable select="document('')"/> gives you the root node of the
stylesheet (the parent of <xsl:stylesheet>)
<xsl:variable select="document('data.xml')"/> gives you the root node of
data.xml.
<xsl:variable select="/"/> stores the root node of the xml file, you are
currently working on.
Regards,
Joerg
----- Original Message -----
From: "hnorris" <hnorrisalt@yahoo.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, February 13, 2002 7:53 AM
Subject: [xsl] document() to get root node of xml file???
> Hi Bryan -
>
> Thanks for your reply! Do you ( or anybody else) happen to know how to
use
> the document() function to get to the root node of the xml file that
you're
> applying your stylesheet to? Or are there better, alternative ways of
> getting your
> xml file root node??
>
> Michael Kay suggests in his Xslt 2nd edition book that you can do this
> by using an empty string argument to document(), but I can't get it to
> work - he suggests you have to coordinate the base URI with the
> system id of the stylesheet module, whatever the hell that means(!)
> Examples anyone? Seems extremely complicated. Even more confusing,
> he says that document('') is used to get the root node of the
> stylesheet - what
> would you do with that? Didn't he mean the root node of the xml file
you're
> applying the stylesheet to? His book shows an example which suggests
> this was his actual meaning. Very confusing!!
>
> Any light you can shed on this obscure topic of how to the get your
> root node (for your xml data file), regardless of the current node
context,
> would be greatly appreciated!
>
> - Holten
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list