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!!!
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
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....)
Leverager of our synergies
posted 18 years ago
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