Question: Consider the XML file What are the values of the following XPath expressions? a. /purse/coin[1]/value b. /purse/coin[2]ame c. /purse/coin[2]ame/@lang d. name(/purse/coin[2]/*[1]) e. count(/purse/coin) f. count(/purse/coin[2]ame)

Consider the XML file

0.5 half dollar 0.25 quarter

What are the values of the following XPath expressions?

a. /purse/coin[1]/value

b. /purse/coin[2]ame

c. /purse/coin[2]ame/@lang

d. name(/purse/coin[2]/*[1])

e. count(/purse/coin)

f. count(/purse/coin[2]ame)

0.5 half dollar 0.25 quarter

Step by Step Solution

3.31 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets evaluate the XPath expressions for the given XML file xml 05 half dollar 025 quarter a pursecoi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!