equal
deleted
inserted
replaced
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 <widgets> |
287 <widgets> |
289 <widget> |
288 <widget> |
290 <manufacturer/> |
289 <manufacturer/> |
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> |