This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes what's the difference between / and // in Xpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "what Watch "what New topic
Author

what's the difference between / and // in Xpath

Stephen Ferg
Greenhorn

Joined: Apr 23, 2007
Posts: 9
what's the difference between / and // in Xpath
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

/ selects children of the context node, // selects descendants of the context node.
Stephen Ferg
Greenhorn

Joined: Apr 23, 2007
Posts: 9
what's the difference between children and descendants ? Do you mean "/" only selects its direct children and "//" selects children and grandchildren, etc ?

can you give a simple example showing the difference ?

Thanks!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Yes, that's what I meant. "Child" and "descendant" are standard terminology in XPath. I would really recommend you find some tutorials rather than trying to learn things by asking questions on forums.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what's the difference between / and // in Xpath
 
Similar Threads
Google Select
SCJA?
ClassLoader
What's the difference between & and &&?
Lightweight and heavyweight containers