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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top