Dashboard > ANTLR 3 > ... > Parsing XML > 5. When to use a custom made XML parser
  ANTLR 3 Log In | Sign Up   View a printable version of the current page.  
  5. When to use a custom made XML parser
Added by Oliver Zeigermann, last edited by Matt Benson on Aug 09, 2006  (view change)
Labels: 
(None)

When to use a custom made XML parser 

As discussed in a mailing list threadinitiated by Martin, in many cases it does not make much sense to write your own custom made XML parser. However, there may be some scenarios where I think it may be reasonable:

  1. Parsing fragments: I don't know of any XML parser that robustly handles XML fragments
  2. Minimal adjustments: Sometimes all you want is to change the name of a DTD in the doctype declaration or just want every tag named a to become b while everything else has to stay exactly the same. This is hardly possible with a standard XML parser.
  3. No entity resolving: Usually it is great that an XML parser resolves all your entities. But, especially when you do a transformation, may not always be desirable.
    What do you think? Comments?

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators