Ramon F Herrera
Usenet Archive
- Joined
- Mar 11, 2003
- Messages
- 461
- Reaction score
- 0
My application makes a large number of XPath retrievals and that's the code that predominantly uses most of the clock time. The rest of the tasks take a negligible amount of CPU and disk. In short, all the app does is to read XML variables and write them in a PDF file.
See a previous, very related post below.
-Ramon
Very true. (Though some DOM parsers/loaders bypass SAX for greater efficiency; I believe Xerces actually uses lower-level events to drive its DOM construction.)
SAX does require that you manage all the state information, which may or may not include building something like the DOM for part or all of the document. How fast or slow that will be depends entirely on the problem at hand and how good your code is.
If you've got time, doing it all via SAX may be worth trying. But it isn't always going to be a magic bullet.
As I said in my other post, the first thing to do is to find out whether this is even a significant part of your application's processing time.
See a previous, very related post below.
-Ramon
You can't compare SAX and DOM. SAX is under the parsing level therefore DOM is for manipulating an XML document. DOM is mostly built with SAX system. You can use it or ignore it building your own SAX code. However create your own SAX handler is much complex and the final result could be much slower than with a pure DOM usage.
Very true. (Though some DOM parsers/loaders bypass SAX for greater efficiency; I believe Xerces actually uses lower-level events to drive its DOM construction.)
SAX does require that you manage all the state information, which may or may not include building something like the DOM for part or all of the document. How fast or slow that will be depends entirely on the problem at hand and how good your code is.
If you've got time, doing it all via SAX may be worth trying. But it isn't always going to be a magic bullet.
As I said in my other post, the first thing to do is to find out whether this is even a significant part of your application's processing time.