This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to parse this xml response from server -- tag Data1 is repeating itself? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to parse this xml response from server -- tag Data1 is repeating itself?" Watch "How to parse this xml response from server -- tag Data1 is repeating itself?" New topic
Author

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

Adrian Burlington
Ranch Hand

Joined: Jun 16, 2009
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
Don't get me started about those stupid light bulbs.
 
subject: How to parse this xml response from server -- tag Data1 is repeating itself?