• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axes question

 
Rakesh Gudur
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
What will following expressions evaluate to for the given XML document?
count//child::chapter@name="introduction"]/child::title/following-sibling::* )
-------------------XML Document----------------------
<book>
<author> abc </author>
<chapter name="introduction">
<title>chap 1</title>
<pages>100</pages>
</chapter>
<chapter name="starting">
<version>1.1</version>
<title>chap 2 </title>
<pages>200</pages>
</chapter>
</book>
Answers:
A: 1
B: 2
C: 3
D: 4
E: error
Can any one explain the answer. The answer given in the XML Whiz is 1
Thanks,
Rakesh.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!