File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes How to read XML file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to read XML file ?" Watch "How to read XML file ?" New topic
Author

How to read XML file ?

sandeep balyan
Ranch Hand

Joined: Jul 25, 2001
Posts: 134
I have one XML file which have lot of data and one DB column file .
How can i open this XML file in readable format that is .... user can view data saved in XML file
DB column file have data like
name[profession[place
XML file have
anil[IT[delhi[sanjay[IT[LA
thanks


Want to do something great will do one day
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
How exactly do you want to display the XML and where?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sandeep balyan
Ranch Hand

Joined: Jul 25, 2001
Posts: 134
First of all thanks for your reply ,

This is a file named as database column db.txt
ID]A.NAME]E.NAME]SEX]NATIONALITY.
Data file i.e in XML format is like data.xml
ID]A.NAME]E.NAME]SEX]NATIONALITY
1234] ]Anil kumar] M]USA]

I want to load this file to database .AS we want to see report of all data .
or read it in HTML format .
TIA
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ok. First of all, I'd suggest you should try to search this forum with keywords "xml jdbc" or "xml database". That should give you more than enough of discussions about moving data between XML documents and a database.
Generally speaking, there are two approaches to read stuff from an XML file and insert it into the database. The first one is to use a mapping tool that does all the work for you. I can't name such a tool, however. The other is to write your own code for reading records from the XML file and inserting them into the database.
The second approach, in pseudo-code, would look something like:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read XML file ?