Monday, September 10, 2012

Problems with traditional XML parsers


DOM - Specific problems


  1. Speed - DOM is slow. It is slower than SAX or StAX or Expresso Parser. It's really slow. This doesn't matter too much if you're parsing one file. But what if you're parsing loads of files? It all adds up!
  2. Probably the biggest problem with DOM specifically is memory. It works for small files but it can have memory errors surprisingly quickly!

SAX - Specific problems

  1. Difficulty - SAX is a challenge to use. It's much tougher to learn, especially for those coming  from an Object oriented school of thought.
  2. Parsing complexity - SAX makes you hold your own data structure so for complex parsing searches where you want to find the parent element  and the child element you have to take care of all that tracking and data storage yourself. 
  3. SAX cannot be used to create or modify XML. 


StAX- Specific problems

  1. Difficulty - StAX is easier to use than SAX but it is still much more difficult to set up and adjust to than DOM. 
  2. StAX does not provide a way to validate files. 
  3. The only way to use it is by continuous if-else conditions
  4. There are no access functions for getting child nodes. 

General problems 

These are problems with all the parsers which Expresso fixes

  1. Speed. Expresso is faster than DOM, SAX or StAX.
  2. Memory. Expresso can parse massive files such as 15GB files which can cause problems to even SAX parsers.
  3. Difficult API - expresso takes the pain out of parsing by replacing the difficult job of instantiating a parser, loading files and writing all that parsing code with a graphical parser which is a neat little pop up box allowing you to create parsing rules easily and test them immediately against your live XML file.
  4. Conflicts - With the other parsers you are always dependent on your local environment. There can be conflicts between various parsing libraries, other 3rd party libraries or JVMs. There can be issues when moving from one environment to another. Expresso is completely cloud based. 
  5. No general way to share XML parsing rules -  Expresso provides a secure online place to share XML files and their parsing rules within an organisation using fine grained access control. 
  6. No general visual environment for managing XML files and parsing rules - Expresso provides a friendly, visual tool for managing all your XML files. 
  7. You have to load the file - Expresso can work with remote files through HTTPs so you don't need a local copy of the file.



 find out more at www.sxml.com.au




No comments:

Post a Comment