XPATH expression.

Discussion in 'XML' started by Remi COCULA, Dec 17, 2003.

  1. Remi COCULA

    Remi COCULA Guest

    Please help me find a XPATH expression.

    I'm searching to locate all preceding "cousin" nodes of a context element
    node of type foo.
    (cousin = nodes with same grandfather).

    The expression '../../descendant::foo' gives me all foo nodes with the same
    grandfather of the courant node.
    But I don't know how to get only the ones preceding the courant node.
    Remi COCULA, Dec 17, 2003
    #1
    1. Advertising

  2. "Remi COCULA" <> wrote in message
    news:brq8ek$201$...
    > Please help me find a XPATH expression.
    >
    > I'm searching to locate all preceding "cousin" nodes of a context element
    > node of type foo.
    > (cousin = nodes with same grandfather).
    >
    > The expression '../../descendant::foo' gives me all foo nodes with the

    same
    > grandfather of the courant node.
    > But I don't know how to get only the ones preceding the courant node.



    Use:

    preceding-sibling::foo | ../preceding-sibling::*/foo


    Dimitre Novatchev.
    FXSL developer, XML Insider,

    http://fxsl.sourceforge.net/ -- the home of FXSL
    Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
    Dimitre Novatchev, Dec 17, 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,964
    jan V
    Jul 29, 2005
  2. Alastair Cameron
    Replies:
    1
    Views:
    7,391
    SQL Server Development Team [MSFT]
    Jul 8, 2003
  3. Anna
    Replies:
    0
    Views:
    519
  4. goog
    Replies:
    0
    Views:
    504
  5. GIMME
    Replies:
    3
    Views:
    11,942
    vforvikash
    Dec 29, 2008
Loading...

Share This Page