XPath

XPath

XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria.

Originally motivated by a desire to provide a common syntax and behavior model between XPointer and XSLT, subsets of the XPath query language are used in other W3C specifications such as XML Schema, XForms and the Internationalization Tag Set (ITS).

It has been adopted by a number of XML processing libraries and tools, many of which also offer CSS Selectors, another W3C standard, as a simpler alternative to it.

The most important kind of expression in XPath is a location path. A location path consists of a sequence of location steps. Each location step has three components:

an axis
a node test
zero or more predicates.

An XPath expression is evaluated with respect to a context node. An Axis Specifier such as ‘child’ or ‘descendant’ specifies the direction to navigate from the context node. The node test and the predicate are used to filter the nodes specified by the axis specifier: For example, the node test ‘A’ requires that all nodes navigated to must have label ‘A’. A predicate can be used to specify that the selected nodes have certain properties, which are specified by XPath expressions themselves.

The XPath syntax comes in two flavors: the abbreviated syntax, is more compact and allows XPaths to be written and read easily using intuitive and, in many cases, familiar characters and constructs. The full syntax is more verbose, but allows for more options to be specified, and is more descriptive if read carefully.

IT Professionals, Web Developers, Web Programmers, IT students can Apply for the certification course to move ahead in their careers.

 

Angular 4 Tutorial IndexBack to Angular 4 Tutorial Main Page

Get industry recognized certification – Contact us

Menu