• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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.>
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic