• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading different attributes values in Nodelist with same name

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a webservice returning me a response which pretty much looks like this


I have an Xpath Util which uses Xpath to traverese and read this piece of code


But answer 1 and answer 2 retrieved are same..

Any help is appreciated !
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've a pile of NodeList and Node variables that do not relate to one another logically and codewise... that make the question very confusing.

For what I understand, you use everywhere absolute path that makes the current node (the context) quite irrelevant and that is the reason. (A side-note: the tag names are case sensitive. response and Response are not the same; also some path is clearly invalid such as /response/question/ with a backslash at the end.)

The general idea is reflected in this clean up that I can abstract out from your post.

Everything is untested but test-ready.>
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic