Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XPath and documents

Reply
Thread Tools

XPath and documents

 
 
Serge Malonga
Guest
Posts: n/a
 
      08-01-2003
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



 
Reply With Quote
 
 
 
 
Andy Fish
Guest
Posts: n/a
 
      08-01-2003
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

"Serge Malonga" <(E-Mail Removed)> wrote in message
news:bgd7tt$ant$(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No more stuff on C:\Documents and Settings\[User]\My Documents\Visual Studio 2005\ craigkenisston@hotmail.com ASP .Net 1 10-18-2006 03:31 PM
JAXP XPath expression compare Documents Jeff Higgins XML 0 09-27-2005 07:47 PM
"Memory leak" in javax.xml.xpath.XPath Marvin_123456 Java 4 07-29-2005 03:49 PM
Problem selecting a node with XPATH if attribute value contains backslashes - how to force XPATH string to be treated as literal? Alastair Cameron XML 1 07-08-2003 07:24 PM



Advertisments