Big Java Late Objects
Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
Expert Solution & Answer
Book Icon
Chapter 24, Problem 11RE

Explanation of Solution

XPath:

The easiest way to inspect the XML document is by using the XPath syntax.

  • In the DOM standard, a node is a common superclass for all the components that is present in the XML document.
  • To be precise, nodes are elements and text sequences.
  • XPath describes a node or set of nodes, the syntax of XPath is similar to that of directory paths.

Example:

/items/item[1]/quantity

 The above XPath selects the quantity of the first item.

 Result of evaluating the following XPath expressions:

 a. Expression to get the value of the first coin

 The XPath expression that is used to get the value of the first coin is “/purse/coin[1]/value

 B Number of coins:

 The XPath expression that is used to get the number of coins is “count(/purse/coin)”...

Blurred answer
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education