Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

SAX and DOM parser

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to know which one of DOM or SAX parser is better?I need to generate a new xml file from an existing xml template on server.

Kindly help.

Regards.
 
Sheriff
Posts: 24632
56
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I had an assignment like that ("generate one XML file from another XML file") then the first tool I would consider would be XSLT. I wouldn't consider low-level tools like SAX and DOM parsers until I was sure that XSLT couldn't do the job.
 
neha priya
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.In my case i have a xml template on the server.I need to collect data across various jsp pages and create a new xml file based on the xml template and populate the collected data over there.At the end of this, the template xml should remain as it was before.How do i use XSLT as you mentioned to achieve the same.
Kindly Help.

Regards.
 
Paul Clapham
Sheriff
Posts: 24632
56
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea. It would depend on what data you were collecting and how much of it there was and how it was structured. If you're going to do this kind of evaluation you have to produce a proper set of requirements.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I had an assignment like that ("generate one XML file from another XML file") then the first tool I would consider would be Perl. I wouldn't consider XSLT because of it's awkward programming style and inability to store program data efficiently. Moreover, the pattern-matching features of Perl are very powerful and flexible.
 
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!