E a tree simple example doc newxmldoc root

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ame that you wish to locate •  The op8onal predicate filters the qualifying nodes. XPath syntax •  We will use only very simple Xpath expressions •  The axis will be either –  “child”, which is the default and can be dropped, or –  “descendant- or- self”, which says look anywhere down the tree and is abbreviated by “//” –  “self” which is abbreviated with a . •  The nodetest will always be a node name •  The predicate is op8onal and will either be a number, [2] which asks for, e.g., the second node, or an arribute filter, e.g., [@currency = “JPY” or @currency=“USD”] ! Func8ons that take XPath expressions •  getNodeSet(xmlTree, xpathExpression) returns a list of XML nodes from xmlTree that sa8sfy the XPath expression. •  xpathSApply(xmlTree, xpath, function) the func8on is applied to those nodes in the XML tree that sa8sfy the Xpath expression. The return value...
View Full Document

Ask a homework question - tutors are online