XPath and documents

S

Serge Malonga

Hello,

Very basic question about XPATH but I can find nowhere a comment about it.
- function document("filename") returns the tree node of the xml file
"filename".
- function document("") returns the current processing xsl file.
- Question : how do I get the input XML document ? "/" should work of
course, unless you are lost in a template transforming another
document("...").

Thanks in advance for your comments.

Sergiogio
 
A

Andy Fish

you do things like: (untested)

<xsl:value-of select="document('foo.xml')/foo/bar[2])"/>
or

<xsl:variable name="mydoc" select="document('foo.xml')"/>
<xsl:value-of select="$mydoc/foo/bar[2]"/>

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top