What does self::* means in XPath

Discussion in 'XML' started by Vijay, Mar 22, 2005.

  1. Vijay

    Vijay Guest

    Hi

    Can anybody explain what self::* means in Xpath. I understand that
    "self" means the context node itself and * means any node type. So I
    thought self::* meant all the child nodes of context, but I some where
    read that self::* mean ".", the context itself. Can somebody please
    explain this.

    Vijay
    Vijay, Mar 22, 2005
    #1
    1. Advertising

  2. Vijay wrote:


    > Can anybody explain what self::* means in Xpath. I understand that
    > "self" means the context node itself and * means any node type. So I
    > thought self::* meant all the child nodes of context, but I some where
    > read that self::* mean ".", the context itself. Can somebody please
    > explain this.


    self is a so called axis in XPath along you can select nodes:
    <http://www.w3.org/TR/xpath#axes>
    * is a node test, it is true for any node type of the principal node
    type of an axis, for the self axis that is the element node type.
    If you have
    self::*
    then that is a so called location step, selecting any node along the
    axis self of the type element.
    As the self axis contains only the context node by definition
    self::*
    will either select the context node itself if that is an element node or
    an empty nodeset otherwise.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Mar 22, 2005
    #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. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    559
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    578
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    389
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    357
    falcon
    Jul 31, 2005
  5. Bart Kastermans
    Replies:
    6
    Views:
    383
    Bart Kastermans
    Jul 13, 2008
Loading...

Share This Page