[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: The document() function....again !!

Subject: RE: The document() function....again !!
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 16 Oct 2000 11:12:56 +0100
alan kay function
> While I am an eager to get help from anyone, I want to direct 
> this question
> to "our teachers" in the group (Alan Kay, Jeni Tennison, and others).

Alan Kay is the Smalltalk man. Wrong language...

> Could someone please explain what goes on in the the XSLT call to
> document().
> 
>              <xsl:apply-templates
> select="document(somefile.xml)/some_element[@aval='true']"

try document('somfile.xml')

> 2.)   In [Mike] Kay's Wrox text on XSLT he goes to great length 
> to draw the
> schematics of the XML input tree, XSLT transform and output trees.
>        How is that structure impacted by a call to document() 
> ? Is a second
> Input tree created ?  If so what mechanism is used to
>       alternate between those data structures.

Yes, a second input tree is created. To get back to the original tree, it's
a good idea to have a global variable

<xsl:variable name="root" select="/"/>

so you can get back any time using $root. To get back to the secondary
document, just call document() again with the same URI, or set up another
global variable.

Note that many XPath expressions such as "//item" or "key('k', $val)"
implicitly access the "current document", i.e. the one containing the
context node.

Mike Kay 


 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.