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

Re: XSL doubts

Subject: Re: XSL doubts
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Mon, 22 Apr 2002 23:33:08 -0700
xsl acess variable
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 22 April 2002 23:04, saravanababuraman@xxxxxxxxxxx wrote:
> Hai Friend
>
> well i have a doubt about the document open ,if i open the document as loop
> i could not able to acess the root variable from the XML inside the
> docuemnt loop do you find any solution for these please explain me the
> solution for these in the respected mail id saravanababuraman@xxxxxxxxxxx

In the future you might consider posting to the XSL mailing list; most people 
do not appreciate being contacted directly.

About your question, yes, this is a frequent problem.  The solution is to 
store a reference to the root of the first document in a variable before the 
for-each, and then access the first document through that variable:

<xsl:variable name="root" select="/"/>
<xsl:for-each select="document('foo.xml')/bar">
  ...
  <!-- access the /baz/zoit elements in the original document -->
  <xsl:value-of select="$root/bar/zoit"/>
  ...
</xsl:for-each>

Let me know if this helps.  Also, if you use the key() function, there are 
other things you have to do.

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8xQAsNSZCJx7tYycRAgFKAJ9xHofbwao7JXqynLR1Hofme5lypQCfVxYl
iSy08Gmwrq9CTC1tB5V5tX4=
=gwst
-----END PGP SIGNATURE-----


 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.