[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???

Subject: Re: document() to get root node of xml file???
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Wed, 13 Feb 2002 09:25:37 +0100
xml get root node
<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.