< prev index next >
src/java.xml/share/classes/javax/xml/xpath/package-info.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 48,58 ****
* <li><a href='#XPath.Context'>4. XPath Context</a></li>
* <li><a href='#XPath.Use'>5. Using the XPath API</a></li>
* </ul>
* <p>
* <a id="XPath.Overview"></a>
! * <h3>1. XPath Overview</h3>
*
* <p>
* The XPath language provides a simple, concise syntax for selecting
* nodes from an XML document. XPath also provides rules for converting a
* node in an XML document object model (DOM) tree to a boolean, double,
--- 48,58 ----
* <li><a href='#XPath.Context'>4. XPath Context</a></li>
* <li><a href='#XPath.Use'>5. Using the XPath API</a></li>
* </ul>
* <p>
* <a id="XPath.Overview"></a>
! * <h2>1. XPath Overview</h2>
*
* <p>
* The XPath language provides a simple, concise syntax for selecting
* nodes from an XML document. XPath also provides rules for converting a
* node in an XML document object model (DOM) tree to a boolean, double,
*** 67,77 ****
* stand-alone language, as a single XPath expression can be used to
* replace many lines of DOM API code.
*
*
* <a id="XPath.Expressions"></a>
! * <h3>2. XPath Expressions</h3>
*
* <p>
* An XPath <em>expression</em> is composed of a <em>location
* path</em> and one or more optional <em>predicates</em>. Expressions
* may also include XPath variables.
--- 67,77 ----
* stand-alone language, as a single XPath expression can be used to
* replace many lines of DOM API code.
*
*
* <a id="XPath.Expressions"></a>
! * <h2>2. XPath Expressions</h2>
*
* <p>
* An XPath <em>expression</em> is composed of a <em>location
* path</em> and one or more optional <em>predicates</em>. Expressions
* may also include XPath variables.
*** 209,219 ****
* //foo[@include='true'][@mode='bar']
* </pre>
* </blockquote>
*
* <a id="XPath.Datatypes"></a>
! * <h3>3. XPath Data Types</h3>
*
* <p>
* While XPath expressions select nodes in the XML document, the XPath
* API allows the selected nodes to be coalesced into one of the
* following data types:
--- 209,219 ----
* //foo[@include='true'][@mode='bar']
* </pre>
* </blockquote>
*
* <a id="XPath.Datatypes"></a>
! * <h2>3. XPath Data Types</h2>
*
* <p>
* While XPath expressions select nodes in the XML document, the XPath
* API allows the selected nodes to be coalesced into one of the
* following data types:
*** 223,233 ****
* <li><code>Number</code></li>
* <li><code>String</code></li>
* </ul>
*
* <a id="XPath.Datatypes.QName"></a>
! * <h3>3.1 QName types</h3>
* The XPath API defines the following {@link javax.xml.namespace.QName} types to
* represent return types of an XPath evaluation:
* <ul>
* <li>{@link javax.xml.xpath.XPathConstants#NODESET}</li>
* <li>{@link javax.xml.xpath.XPathConstants#NODE}</li>
--- 223,233 ----
* <li><code>Number</code></li>
* <li><code>String</code></li>
* </ul>
*
* <a id="XPath.Datatypes.QName"></a>
! * <h2>3.1 QName types</h2>
* The XPath API defines the following {@link javax.xml.namespace.QName} types to
* represent return types of an XPath evaluation:
* <ul>
* <li>{@link javax.xml.xpath.XPathConstants#NODESET}</li>
* <li>{@link javax.xml.xpath.XPathConstants#NODE}</li>
*** 256,266 ****
* <p>
* The <code>Number</code> return type attempts to coalesce the text
* of a node to a <code>double</code> data type.
*
* <a id="XPath.Datatypes.Class"></a>
! * <h3>3.2 Class types</h3>
* In addition to the QName types, the XPath API supports the use of Class types
* through the <code>XPathExpression.evaluteExpression(...)</code> or
* <code>XPath.evaluateExpression(...)</code> methods.
*
* The XPath data types are mapped to Class types as follows:
--- 256,266 ----
* <p>
* The <code>Number</code> return type attempts to coalesce the text
* of a node to a <code>double</code> data type.
*
* <a id="XPath.Datatypes.Class"></a>
! * <h2>3.2 Class types</h2>
* In addition to the QName types, the XPath API supports the use of Class types
* through the <code>XPathExpression.evaluteExpression(...)</code> or
* <code>XPath.evaluateExpression(...)</code> methods.
*
* The XPath data types are mapped to Class types as follows:
*** 274,291 ****
*
* <p>
* Of the subtypes of Number, only Double, Integer and Long are supported.
*
* <a id="XPath.Datatypes.Enum"></a>
! * <h3>3.3 Enum types</h3>
* 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 <code>XPathExpression.evaluteExpression(...)</code>
* or <code>XPath.evaluateExpression(...)</code> methods will be of one of these types.
*
* <a id="XPath.Context"></a>
! * <h3>4. XPath Context</h3>
*
* <p>
* XPath location paths may be relative to a particular node in the
* document, known as the <code>context</code>. A context consists of:
* <ul>
--- 274,291 ----
*
* <p>
* Of the subtypes of Number, only Double, Integer and Long are supported.
*
* <a id="XPath.Datatypes.Enum"></a>
! * <h2>3.3 Enum types</h2>
* 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 <code>XPathExpression.evaluteExpression(...)</code>
* or <code>XPath.evaluateExpression(...)</code> methods will be of one of these types.
*
* <a id="XPath.Context"></a>
! * <h2>4. XPath Context</h2>
*
* <p>
* XPath location paths may be relative to a particular node in the
* document, known as the <code>context</code>. A context consists of:
* <ul>
*** 299,309 ****
* <p>
* It is an XML document tree represented as a hierarchy of nodes, a
* {@link org.w3c.dom.Node} for example, in the JDK implementation.
*
* <a id="XPath.Use"></a>
! * <h3>5. Using the XPath API</h3>
*
* Consider the following XML document:
* <blockquote>
* <pre>
* <widgets>
--- 299,309 ----
* <p>
* It is an XML document tree represented as a hierarchy of nodes, a
* {@link org.w3c.dom.Node} for example, in the JDK implementation.
*
* <a id="XPath.Use"></a>
! * <h2>5. Using the XPath API</h2>
*
* Consider the following XML document:
* <blockquote>
* <pre>
* <widgets>
< prev index next >