Jump to content

Xpath question....


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...