Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parsing XML file with duplicate tags

843834Mar 23 2010 — edited Mar 24 2010
I have an XML file like this;
<Person>
 <Name>Jepps</Name> 
 <NameStart>434</NameStart> 
 <NameStop>34</NameStop> 
 <Scenario>No</Scenario> 
 <More>OK</More> 
 <Pattern>
       <Start>12</Start> 
       <Stop>1212</Stop> 
       <Start>1212</Start> 
       <Stop>121212</Stop> 
       <Start>434</Start> 
       <Stop>4444</Stop> 
       <Start>6665</Start> 
       <Stop>777</Stop> 
       <Start>5</Start> 
       <Stop>454</Stop> 
  </Pattern>
</Person>
I'm having problems parsing the file, because of the duplicate Start/Stop-tags. I am only able to parse the first Start and Stop-tags (I.e. "12" and "1212" is the only printed values).
Any ideas on how to parse the other values as well?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2010
Added on Mar 23 2010
4 comments
3,661 views