• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Collections

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have an XML File of the following format
<parent>
<Child id=1>
<Element1>
<Element2>
........
........
<Element N>
</Child>
<Child id=2>
<Element1>
<Element2>
........
........
<Element N>
</Child>
..........
...........
<Child id=n>
</Parent>
..
Now i want to retrieve the values from this given the child id(i,e if i want to details of child with id=1, i will give the id and i need all the elements falling under child with id=1). could you suggest me which collection to use and it would be of great help if i could get a sample code for it.
Thanks in advance.
Rima
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of a collection class that maps to XML - certainly there is none in the core class libraries. Are you familiar with XML processing? The XPath functionality of the JAXP API (which is part of core Java) seems a good fit for this problem; you can find introductions linked in the XML FAQ.
reply
    Bookmark Topic Watch Topic
  • New Topic