|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








