• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JAXP, Xalan, Xerces, XML4J... HELP!!!!  RSS feed

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am so confused......I am learing XML and each tutorial on the net, suggest to get a different parser, and inturn different SAX, DOM api's..... Is there a guideline I need to follow to know what to use and when to use what?
Will the SAX and DOM api's differe according to different Parsers...
Does it matter which parser I am using when I try to parse my XML..
Please somebody help!!!
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala, to confuse you even more there are two articles:
Choose Your Java XML Parser
�...Parsers differ significantly in performance, reliability, and conformance to standards. This article compares the Xerces, Oracle and Sun parsers�
XML Parsers: DOM and SAX Put to the Test, by Steve Franklin
�...Before making the important decision to purchase an XML parser, look at the results of Steve Franklin's test of a selection of both DOM- and SAX-based parsers�
Maybe other people can give more practical advice
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for how DOM parsers are different from SAX parsers, you can search this forum for more information, just two links to start: http://www.javaranch.com/ubb/Forum31/HTML/000221.html http://www.javaranch.com/ubb/Forum31/HTML/000239.html
 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the help. I have one moew question...
As for using DOM or SAX can I can any parser or the selection depends on the DOM and SAX API used? (I am not sure if the question makes any sence....)
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emmm... Both DOM and SAX are sets of interfaces, defined by W3C. Parsers implements these interfaces and may differ in small details, but essentially two DOM parsers, for example, have to provide the same functionality, otherwise why call them �DOM parsers�? There are, however, DOM level1 and DOM level2 (the same about SAX) compliance. Level2 is different from Level1 in that parsers have to support namespaces, as far as I know.
If you have to choose the parser, you should first decide if you want to use DOM or SAX parser, considering two factors:
1) how big your XML documents are (DOM representation in memory can be 5-10 times more than the source document!)
2) what kind of processing you need to apply.
Then you choose any Level2 (because there seems to be no reason to use older) parser. Then you write your program and see what happen: if some exotic feature is not supported by your parser, you can always use another
 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mapraputa Is, Tanks. That's big help!!
 
Let's go to the waterfront with this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!