diff -r 13796d1d9f0a -r 8a151bf73222 jaxp/src/java.xml/share/classes/javax/xml/xpath/package.html
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/package.html Mon May 15 20:27:38 2017 -0700
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/package.html Tue May 16 17:36:12 2017 -0700
@@ -1,8 +1,8 @@
-
+
-
+
This package provides an object-model neutral API for the
evaluation of XPath expressions and access to the evaluation
@@ -36,7 +36,7 @@
The XPath API supports
XML Path Language (XPath) Version 1.0
-
+
-
+
1. XPath Overview
The XPath language provides a simple, concise syntax for selecting
@@ -69,7 +69,7 @@
replace many lines of DOM API code.
-
+
2. XPath Expressions
An XPath expression is composed of a location
@@ -139,11 +139,15 @@
nodes. The following table gives examples of location paths for each
of these node types:
-
+
+Examples of Location Path
+
-Location Path |
-Description |
+Location Path |
+Description |
+
+
/foo/bar/@id
@@ -171,6 +175,7 @@
<bar> element.
|
+
Predicates allow for refining the nodes selected by an XPath
@@ -194,7 +199,7 @@
-
+
3. XPath Data Types
While XPath expressions select nodes in the XML document, the XPath
@@ -207,7 +212,7 @@
String
-
+
3.1 QName types
The XPath API defines the following {@link javax.xml.namespace.QName} types to
represent return types of an XPath evaluation:
@@ -236,7 +241,7 @@
The Number
return type attempts to coalesce the text
of a node to a double
data type.
-
+
3.2 Class types
In addition to the QName types, the XPath API supports the use of Class types
through the XPathExpression.evaluteExpression(...)
or
@@ -254,14 +259,14 @@
Of the subtypes of Number, only Double, Integer and Long are supported.
-
+
3.3 Enum types
Enum types are defined in {@link javax.xml.xpath.XPathEvaluationResult.XPathResultType}
that provide mappings between the QName and Class types above. The result of
evaluating an expression using the XPathExpression.evaluteExpression(...)
or XPath.evaluateExpression(...)
methods will be of one of these types.
-
+
4. XPath Context
XPath location paths may be relative to a particular node in the
@@ -278,7 +283,7 @@
It is an XML document tree represented as a hierarchy of nodes, a
{@link org.w3c.dom.Node} for example, in the JDK implementation.
-
+
5. Using the XPath API
Consider the following XML document: