Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to parse this xml response from server -- tag Data1 is repeating itself?

 
Adrian Burlington
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm receiving an xml response from a server that looks like this (pic below).
Question: note 2 Data1:

<Data1>5</Data1>
<Data1>20</Data1>

I wish to retrieve those numbers with my code but unable to do so because the response Column is the same.
I get:
Data result 1 : 5
Data result 2 : 5


Any way to circumvent this?



 
Paul Clapham
Sheriff
Posts: 21312
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code you posted says, in effect:



It appears that you want something different, something like this:



Am I right? If so then write code which does that. There's nothing web-servicey about that, it's just a matter of doing the DOM-bashing right.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic