This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Why I can't retrieve records stored in a XMLFile correctly?
Mellihoney Michael
Ranch Hand
Joined: Nov 27, 2002
Posts: 124
posted
0
Why I can't retrieve records stored in a XMLFile correctly? ReadXMLFile.java
the xml file is: address.xml
the output:
---------------------------------------------------------------------- But the output is supposed to be
can anyone help to explain me? [ January 14, 2004: Message edited by: Mellihoney Michael ]
a beginner in java
Ray Stojonic
Ranch Hand
Joined: Aug 08, 2003
Posts: 326
posted
0
The #text tags are the closing tags of your nodes. If you want to work with XML, I'd recommend learning to use SAX and JDOM.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
1
posted
0
You are seeing a lot of text nodes that contain the crlf and spaces of your formatted XML. Rather than index through the child nodes, consider use of the getElementsByTagName method to go directly to the Elements you want. Bill