5. When to use a custom made XML parser

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?