Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing XML?

 
Andreas Johansson
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Andreas Johansson
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic