Trials with XPath
Illustrating various ways to make use of a single XPath expression
to extract data from an XML document.
- The document is a list of names & marks (see here
for details)
- Target : various pieces of information about students whose
mark
is above a certain bound.
Typically, with file
= NN.1.xml
and bound
= 15
jfp$ java TryXPath NN.1.xml 15
List of students having a mark above 15
अश्विन्
Đức
Hélène
One of the students (node) having a mark above 15
अश्विन्
One of the students (name) having a mark above 15
अश्विन्
Are there any students having a mark above 15 ?
Yes!
Average mark of students having a mark above 15
17.0
Thats'all folks!
jfp$
Here is the code TryXPath.java