jQuery in Action, 2nd edition*
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
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: 18716
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to parse this xml response from server -- tag Data1 is repeating itself?