Jump to content

Xpath question....


hectorsales

Recommended Posts

Try any XPath tutorial."." denotes the context node, ".." the parent node.So"./task" selects the "task" child elements of the context node while "../task" selects the "task" child elements of the parent node of the context node.Usually you would simply use "task"instead of "./task"As for ".//task", it is short for "./descendant-or-self::node()/task", see http://www.w3.org/TR/xpath/#path-abbrev for details which says

// is short for /descendant-or-self::node()/. For example, //para is short for /descendant-or-self::node()/child::para and so will select any para element in the document (even a para element that is a document element will be selected by //para since the document element node is a child of the root node); div//para is short for div/descendant-or-self::node()/child::para and so will select all para descendants of div children.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...