XPath Axes
|
Mittellinie definiert Nullpunkt-einstellte im Verh�ltnis zu dem gegenw�rtigen Nullpunkt.
|
Xpath Axes
|
There are thirteen different axes in the XPath specification. An axis
represents a relationship to the context node, and is used to locate nodes
relative to the tree. The following is an extremely brief
description of thirteen available axes
|
-
Ancestor
This indicates all the ancestors of the context node beginning with the parent node
and traveling through to the root node.
-
Ancestor-or-self
Indicates the context node and all of its ancestors, including the root node.
-
Attribute
Indicates the attributes of the context node.
This axis can be abbreviated with the at sign (@).
-
Child
This Indicates the children of the context node. If an XPath expression does not
specify an axis,then it is understood by default. Since only the root node or element
nodes have children,any other use will select nothing.
-
Descendant
Indicates all the children of the context node, and all of their children,
and so forth. Attribute and namespace nodes are not included - the parent of an
attribute node is an element node, but attribute nodes are not the children of
their parents.
-
Descendant-or-self
Indicates the context node and all of its descendants. Attribute and namespace
nodes are not included - the parent of an attribute node is an element node, but
attribute nodes are not the children of their parents.
-
Following
Indicates all the nodes that appear after the context node, except any
descendant, attribute, and namespace nodes.
-
Following-sibling
Indicates all the nodes that have the same parent as the context node and appear
after the context node in the source document.
-
Namespace
Indicates all the nodes that are in scope for the context node. In this case,
the context node must be an element node.
-
Parent
Indicates the single node that is the parent of the context node. It can be
abbreviated as two periods (..).
-
preceding
Indicates all the nodes that precede the context node in the document except any
ancestor, attribute and namespace nodes.
-
preceding-sibling
Indicates all the nodes that have the same parent as the context node and appear
before the context node in the source document.
-
self
Indicates the context node itself. It can be abbreviated as a single period (.).
|
Location Path Expression
|
A location path can be relative or absolute.
An absolute location path starts with a slash ( / ) but relative location path
does not. In both cases the location path consists of one or more steps, each
separated by a slash:
|
An absolute location path:
/step/step/...
A relative location path:
step/step/...
|
Aller Schritt wird gegen die Nullpunkte im gegenw�rtigen Nullpunkt-einstellte ausgewertet.
Ein Schritt besteht:
- Eine Mittellinie, die das Baumverh�ltnis zwischen den vorgew�hlten Nullpunkten und dem gegenw�rtigen Nullpunkt definiert
- Nullpunkttest, der einen Nullpunkt innerhalb einer Mittellinie kennzeichnet
- Null oder mehr Pr�dikate f�r weiteres verfeinern vorgew�hlt Nullpunkt-einstellten
Syntax des Position Schrittes:
|
axisname::nodetest[predicate]
|
Example |
Result |
child::book |
Selects all book nodes that are children of the current
node
|
attribute::lang |
Selects the lang attribute of the current node |
child::* |
Selects all children of the current node |
attribute::* |
Selects all attributes of the current node |
child::text() |
Selects all text child nodes of the current node |
child::node() |
Selects all child nodes of the current node |
descendant::book |
Selects all book descendants of the current node |
ancestor::book |
Selects all book ancestors of the current node |
ancestor-or-self::book |
Selects all book ancestors of the current node - and
the current as well if it is a book node |
child::*/child::price |
Selects all price grandchildren of the current node |
|
|
Keywords: xpath tutorial,
xsl xpath,
xpath xslt,
xpath xml,
xpath reference,
javascript xpath,
xpath examples,
xpath name,
xpath syntax,
xpath attribute,
xpath html,
xpath attributes,
xpath sort,
xpath cdata,
xpath functions,
xpath text,
xpath w3schools,
xpath position,
xpath example,
xpath variable,
xpath count,
xpath tutorials,
xpath namespace,
xpath xmlns,
xpath sorting,
xpath document,
xpath if,
xpath concat,
xpath w3c,
xpath sum,
xpath contains,
xpath c#,
xpath parent,
xpath editor,
xpath substring,
xpath value,
xpath xalan,
xpath replace,
xquery xpath,
xpath function,
xpath id,
xpath node,
xpath number,
xpath match,
xpath expression,
msxml xpath,
xpath xsd,
xpath date,
xpath element,
xpath dom,
xpath child,
select xpath,
xpath using,
xpath string,
schema xpath,
xpath empty,
xpath axis,
xslt axis,
multiple axes,
xsl axis
|