jaxp/src/java.xml/share/classes/javax/xml/xpath/package.html
changeset 29999 8493f5fc1052
parent 28695 427254b89b9e
child 45261 8a151bf73222
equal deleted inserted replaced
29963:ac3f5a39d4ff 29999:8493f5fc1052
   280 
   280 
   281 <a name="XPath.Use"></a>
   281 <a name="XPath.Use"></a>
   282 <h3>5. Using the XPath API</h3>
   282 <h3>5. Using the XPath API</h3>
   283 
   283 
   284 Consider the following XML document:
   284 Consider the following XML document:
   285 <p>
       
   286 <blockquote>
   285 <blockquote>
   287 <pre>
   286 <pre>
   288 &lt;widgets&gt;
   287 &lt;widgets&gt;
   289 &lt;widget&gt;
   288 &lt;widget&gt;
   290 &lt;manufacturer/&gt;
   289 &lt;manufacturer/&gt;
   364 <p>
   363 <p>
   365 The XPath 1.0 Number data type is defined as a double. However, the XPath 
   364 The XPath 1.0 Number data type is defined as a double. However, the XPath 
   366 specification also provides functions that returns Integer type. To facilitate
   365 specification also provides functions that returns Integer type. To facilitate
   367 such operations, the XPath API allows Integer and Long to be used in 
   366 such operations, the XPath API allows Integer and Long to be used in 
   368 {@code evaluateExpression} method such as the following code: 
   367 {@code evaluateExpression} method such as the following code: 
   369 <p>
       
   370 <blockquote>
   368 <blockquote>
   371 <pre>
   369 <pre>
   372 int count = xpath.evaluate("count(/widgets/widget)", document, Integer.class);
   370 int count = xpath.evaluate("count(/widgets/widget)", document, Integer.class);
   373 </pre>
   371 </pre>
   374 </blockquote>
   372 </blockquote>