i need help...im so lost
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 print out the output in the console like this...
(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)
meaning it will travers to the very inner child node and go up to the root
anyway is it possible to be done?
ive try few example but it cant read the value unless we do it something like
..i need to make the code flexible as i dont know the name of element in xml files.
is there any example that similar to this.hope someone able to help me..
thanks in advance