aspose file tools*
The moose likes XML and Related Technologies and the fly likes Writing XML? 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 "Writing XML?" Watch "Writing XML?" New topic
Author

Writing XML?

Andreas Johansson
Ranch Hand

Joined: Feb 05, 2001
Posts: 43
I'm developing a server that should be able to export it's data to XML as well as import it again (from XML).
I have a standard format DTD which the XML-file should comply to.
How should I write to the XML-file and read it in? (using JDK1.4) What tools/APIs should I use? (SAX? DOM? Other?)
/Andreas
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Andreas Johansson:
I'm developing a server that should be able to export it's data to XML as well as import it again (from XML).
I have a standard format DTD which the XML-file should comply to.
How should I write to the XML-file and read it in? (using JDK1.4) What tools/APIs should I use? (SAX? DOM? Other?)
/Andreas

the answer for two of your question is Using JDBC to extract data into XML and Using JDBC to insert data from XML into a database
you can search "dom or sax" in this forum to get some results.Its also depends on your business criteria, if you could explain more about your XML ,DB structure,then someone may give you some suggestiosns
Regards
Balaji


Spritle Software Blogs
Andreas Johansson
Ranch Hand

Joined: Feb 05, 2001
Posts: 43
Hi!
Thanks for your reply!
I have gazed through the examples but they are too tightly coupled to the database. I want it independent from the database structure.
I understand that DOM and SAX are the predominant techniques but which one should I use? What are their benefits and drawbacks?
The XML-files has to conform to LISAs (Localisation Industry Standards Assocation) TBX (TermBase eXchange) DTD-format and the server should be able to both read and write those files. The XML-file is only intended for importing of 3rd party data in this format and exporting the data from the server so that others can use it. The files will never be modified, they are merely data exchange.
Regards
Andreas
 
 
subject: Writing XML?