XPath

XPath (XML Path Language) is a terse (non-XML) syntax for addressing portions of an XML document.

Originally motivated by a desire to provide a common syntax and behavior model between XPointer and XSL, XPath has rapidly been adopted by developers as a small query language.

Table of contents
1 Notation
2 Examples
3 External Links

Notation

The notation is compact, suitable for expressing within XML attributes. A typical XPath expression is a _Location Path_ consisting of a string of element or attribute qualifiers separated by forward slashes ("/"), similar in appearance to a file system path. XPath also allows built-in functions, filters, bound variable access, and axis specifiers.

Location Paths are divided into Steps, each of which has three components:

An Axis Specifier indicates the kind of information which will be selected. For instance, _child::_ is the unabbreviated axis specifier for element children. For many XPath expressions, the axis specifier is omitted allowing it to default to _child::_. A common abbreviated axis specifier is a commercial "at" sign ("@"), which represents attributes.

A Node Test limits the specific elements or attributes which will be addressed. A common form of node test is a _name test_ which is the name of an element or an attribute.

Predicates are used to filter out, or exclude, certain nodes on the basis of more complex expressions. Predicates are introduced using a square-bracket ("[", "]") syntax.

Examples

An exhaustive set of examples is beyond the scope of this article. Some typical XPath expressions which might be used in an XSL context are:

;The Root element: /*

; All elements everywhere (implementations of this expression can be very slow): //*

;All Top Level Elements (children of Root): /*/*

;The fifth child element under an element named "FOOB": FOOB[5]

;The element FOOB whose BAZ attribute is "untrue": FOOB[ @BAZ = "untrue" ]

See also:

External Links



In the News

Breast Milk Causes More Cavities Than Cow Milk, According To New Study
In a comparison of fluids fed to infants and toddlers -- cola, sucrose drinks, honey, human milk, cow milk and water -- researchers found that cola, sucrose and honey were by far the worst for young teeth and that human milk caused significantly more cavities than cow milk.

Mapping heart disease: Researchers uncover genes that may dramatically
Studying Drosophila (fruit flies), an international team investigated 7,061 genes and built a detailed map that shows how a portion of these genes contribute to heart function and disease. Importantly, the researchers identified many genes that had not previously been associated with heart disease.

An Initial Assessment of the Impact of the Earthquake and Tsunami of D
"Summarizes the information available until January 10, 2005 about the seismic shift that took place in the morning of December 26, 2004 in the Indian Ocean in the province of Aceh in Indonesia, and the ensuing tsunami that devastated some areas in East and Southeast Asia. It offers an initial assessment of the possible economic impact of the disaster."Opens directly into a PDF document. From the Asian Development Bank (ADB).

A Quick Guide to Intel's Chips, From Arrandale to Yorkfield
With Intel's developer conference set to kick off Tuesday, we present a guide to the company's latest chips for desktop and laptop PCs.


Research Finds Vigorous Exercise Equals Better Academics
Middle school students who perform more vigorous physical activity than their more sedentary counterparts tend to do better in school, according to a study published today by researchers from Michigan State University and Grand Valley State University.

Tiny particles can deliver antioxidant enzyme to injured heart cells
Researchers have developed microscopic polymer beads that can deliver an antioxidant enzyme made naturally by the body into the heart. Injecting the enzyme-containing particles into rats' hearts after a simulated heart attack reduced the number of dying cells and resulted in improved heart function days later.

Huge Settlement Unearthed At Stonehenge Complex
Excavations supported by National Geographic at Durrington Walls in the Stonehenge World Heritage site have revealed an enormous ancient settlement that once housed hundreds of people. Archaeologists believe the houses were constructed and occupied by the builders of nearby Stonehenge, the legendary monument on England's Salisbury Plain.

[Ironic] LONDON: A jailed cocaine dealer is working as Santa Claus on
John Tams, who dons beard, boots and red suit to work in a cafe's Christmas grotto, said he wanted to give something back to the community...

High-performance Accelerator Mass Spectrometer Opens New Perspectives
The Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) has opened up entirely new perspectives for the geosciences, climate and environmental research with the announcement that it is to fund a new major piece of scientific instrumentation that is unique in Germany.

[Ironic] LONDON: A jailed cocaine dealer is working as Santa Claus on
John Tams, who dons beard, boots and red suit to work in a cafe's Christmas grotto, said he wanted to give something back to the community...




MP3 Music Downloads

Preview songs, Download Free Music,Burn CDs at ITunes.com
iTunes_RGB_9mm

 


Google




InformationQuickFind.com - Find Information Fast

Links | Privacy Policy | News |