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

RE: Accessing the source nodetree while in another con

Subject: RE: Accessing the source nodetree while in another context
From: "Jeff Rosler" <jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Nov 2002 17:36:57 -0700
jeff rosler
Duh. Thanks, all. Sorry, I didn't see it in the faq. my bad.

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
Sent: Wednesday, November 20, 2002 9:45 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Accessing the source nodetree while in another
context


Declare a global variable

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

This is a FAQ.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Jeff Rosler
> Sent: 20 November 2002 15:46
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Accessing the source nodetree while in another context
> 
> 
> Hi All,
> 
> Can anyone tell me if there is a way to access the source 
> nodetree while within another nodetree context? Here's a 
> simple example -
> 
> ...
> <xsl:variable name="mydoc" select="document('mydoc.xml')"/> 
> <xsl:apply-templates select="$mydoc//*"/> ...
> 
> While the apply-templates is run, the context for the current 
> node is set to $mydoc and any templates that are executed use 
> that. If I want to access the nodetree for the source 
> document on which the transform was run, is there a simple 
> syntax to specify it? I see how I could do this if I used an 
> xsl:for as I could copy part of the source nodetree into a 
> variable and just access the variable, but it seems like if I 
> want to use templates, they are going to be in a global scope 
> and I won't be able to access my variable as it isn't in the 
> same scope. Therefore, I would need some syntax to specify 
> the source nodetree directly.
> 
> Thanks for any and all comments. Please let me know if I'm 
> missing something simple :-). Jeff Rosler Consultant 
> Flatirons Solutions Corp 2555 55th Street Suite 100D Boulder, 
> CO  80301 303-544-0514 x11 jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 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.