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

RE: HELP ME! Getting xml filename and node path from diffren

Subject: RE: HELP ME! Getting xml filename and node path from diffrent xml document.
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Sep 2000 09:54:11 +0200 (MET DST)
use saxon help
Hi Anders,

> This is a continuing on the last question.
> I have used the: saxon:evaluate and then concat the doc2.xml with a XPath,
> but how 
> do i use saxon when i need a node-set in return.
> 
> I have tried things like this, 
> (hope you understand what this supose to be) "It's in the same 'area' as my
> last question.".
> 
> <xsl:for-each
> select="saxon:evaluate(concat('$doc2','/xml/adressbook/entry'))">
> 	<xsl:value-of select="saxon:evaluate(concat('$doc2',name/.))" />
> </xsl:for-each>

Maybe I'm missing something, but I think it's simpler than you expect:
<xsl:for-each
     select="saxon:evaluate(concat('$doc2','/xml/adressbook/entry'))">
	<xsl:value-of select="name" />
</xsl:for-each>

The for-each selects all entry elements. These build the context node-set.
>From that node-set you want the name children. 
There's no need to use saxon:evaluate once again.

> doc2.xml (updated)
>  
>  <xml>
> 	<adressbook>
> 		<entry>
> 			<name>Anders Carlberg</name>
>  		</entry>> 	
> 		<entry>
> 			<name>Oliver Becker</name>
>  		</entry>> 		
> 	</adressbook>
>  </xml>

Regards,
Oliver

BTW: name/. means name/self::node(), so that step is really unnecessary.
     Perhaps you had in mind name/text(), i.e. the text child of name.

/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 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.