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

Re: Difficulty with document() and for-each scope

Subject: Re: Difficulty with document() and for-each scope
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 16 Jun 2008 08:52:31 +0200
Re:  Difficulty with document() and for-each scope
Adam Nielsen wrote:

Unfortunately when I do this I use document('') to pull the list of months from the XSLT code itself, but this then stops anything inside the for-each block from being able to pull any further data from the main XML code.


Does anyone know a way around this?


Yes. The de facto (?) way of pulling this trick is to use an anchor variable. Either you set document('')/me:month to a variable, or you set "/" to a variable (before you enter the for-each block). That way you either prevent the scope from shifting to another document (the first approach) or you keep a reference to the original input document (the second approach).


HTH,
Cheers,
-- Abel

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.