• 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

read the XML file

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my XML file
<veryDOC>
<MYDOCUMENT>
<DOCUMENT>
<STUDENT>
<NAME>Anorexic Al</NAME>
<ADDR>10 Slimway Rd</ADDR>
<GRADE>A</GRADE>
</STUDENT>
<STUDENT>
<NAME>Bulimic Bill</NAME>
<ADDR> 123 Upchuck Drive</ADDR>
<GRADE>B+</GRADE>
</STUDENT>
<STUDENT>
<NAME>Cadaverous Chen</NAME>
<ADDR>14 Mordant St.</ADDR>
<GRADE>B-</GRADE>
</STUDENT>
</DOCUMENT>
</MYDOCUMENT>
</veryDOC>

i want to write java code that read all the xml file and out put as below.

(STUDENT , NAME ,Anorexic Al)
(STUDENT , ADDR ,10 Slimway Rd)
(STUDENT , GRADE ,A)
(STUDENT , NAME ,Bulimic Bill)
(STUDENT , ADDR ,123 Upchuck Drive)
(STUDENT , GRADE ,B+)
(STUDENT , NAME ,Cadaverous Chen)
(STUDENT , ADDR ,14 Mordant St)
(STUDENT , GRADE ,B-)
(DOCUMENT , STUDENT , NAME)
(MYDOCUMENT, DOCUMENT,STUDENT)
(veryDOC , MYDOCUMENT ,DOCUMENT)

Anyone have any idea how can i start ? im able to read the the node, nodevalue and node parent...but i wnat to read the
(DOCUMENT , STUDENT , NAME)
(MYDOCUMENT, DOCUMENT,STUDENT)
(veryDOC , MYDOCUMENT ,DOCUMENT)

how can i do that.
hope some can help me...
 
Norazanita Adnan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone help me with this..please..

i badly need help on this topic

please...please
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Norazanita,

you need to use Sun's JAXP. Look here for Sun's JAXP tutorial.
 
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic