• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Writing XML?

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic