XPath and documents

Discussion in 'XML' started by Serge Malonga, Aug 1, 2003.

  1. 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
     
    Serge Malonga, Aug 1, 2003
    #1
    1. Advertising

  2. Serge Malonga

    Andy Fish Guest

    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" <> wrote in message
    news:bgd7tt$ant$...
    > 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
    >
    >
    >
     
    Andy Fish, Aug 1, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marvin_123456

    "Memory leak" in javax.xml.xpath.XPath

    Marvin_123456, Jul 29, 2005, in forum: Java
    Replies:
    4
    Views:
    1,995
    jan V
    Jul 29, 2005
  2. Alastair Cameron
    Replies:
    1
    Views:
    7,445
    SQL Server Development Team [MSFT]
    Jul 8, 2003
  3. Anna
    Replies:
    0
    Views:
    542
  4. Jeff Higgins
    Replies:
    0
    Views:
    464
    Jeff Higgins
    Sep 27, 2005
  5. Replies:
    1
    Views:
    493
    Juan T. Llibre
    Oct 18, 2006
Loading...

Share This Page