xml - what is the difference between these in xpath? -
i new xpath can let me in detail difference between /bookstore/*
, /bookstore
in xpath?
let example input
<bookstore> <book> <title lang="en">harry potter</title> <price>29.99</price> </book> <book> <title lang="en">learning xml</title> <price>39.95</price> </book> </bookstore> <bookstore> <book> <title lang="en">harry potter1</title> <price>29.999</price> </book> <book> <title lang="en">learning xml1</title> <price>39.955</price> </book> </bookstore>
what output in both cases? in advance.
the expression /bookstore/*
select children, /bookstore
select node itself.
for instance, /bookstore/*
select all child elements under /bookstore
, may end collection of elements. note in case more complex expression /bookstore/book/*
, there multiple /bookstore/book
elements, children of matching nodes selected.
the expression /bookstore
select element(s) /bookstore
. similarily above, such select may result in collection of elements if it's down path /bookstore/book
.
Comments
Post a Comment