|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: document() to get root node of xml file???
<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@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, February 13, 2002 7:53 AM
Subject: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








