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

Re: xsl:for-each and document()

Subject: Re: xsl:for-each and document()
From: Jim Hart <jhart@xxxxxxxxx>
Date: Mon, 21 Jul 2003 10:43:53 -0400
xsl for each document
One solution is to add a namespace for the external document. See below.

On Sunday, July 20, 2003, at 01:02 AM, Casale, Jourdain-Alexander wrote:

Hello,

I'm trying to figure out how to access data in the source XML document
while within a for-each loop of another XML document. Does anybody know
how to accomplish this without doing another document() call to the
source XML document?

source.xml
----------------------------------------------
	<element>
		<child>source doc</child>
	</element>

external.xml
----------------------------------------------
<element>
	<child>external doc</child>
<element>

stylesheet.xslt
----------------------------------------------
...
I can display <xsl:value-of select="/element/child"> here
<xsl:for-each select="document('external.xml')/element/*">

< xsl:for-each select="document('external.xml')/element/*" xmlns:ext="http://some/arbitrary/url">
<xsl:value-of select="."/>
<xsl:value-of select="/element/child"/>


	I can display <xsl:value-of select="."/> here
	Problem: I can't display /element/child on my source.xml unless
I do another document() call
</xsl:for-each>


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.