Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query on parent axis in xpath

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi my input xml



My xpath expression



Also tried



My expected result Hello elemet.

Actual Result No elements

Where am i going wrong ?
 
Paul Clapham
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you started from your context node and looked for a child element whose name was Hello. Maybe you found that Hello element and maybe you didn't, depending on what your context node was. Then you looked for a parent of that node which was a Bye element. Presumably that Hello element isn't a child of any Bye element; it certainly isn't if that's your whole document.
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I was reading the expression wrongly !

Yes that was my entire document



This returns to me what i need.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic