Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > What does self::* means in XPath

Reply
Thread Tools

What does self::* means in XPath

 
 
Vijay
Guest
Posts: n/a
 
      03-22-2005
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

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-22-2005


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/
 
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
"Memory leak" in javax.xml.xpath.XPath Marvin_123456 Java 4 07-29-2005 03:49 PM
XPath: efficiency in xpath expressions Tjerk Wolterink XML 1 11-13-2004 06:03 PM
Are there any XPath parsers that generate XPath trees? goog XML 0 01-14-2004 01:47 PM
XPath that does not include other XPath Anna XML 0 07-31-2003 07:55 AM
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