Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory for SAXParser parsing XML without DOCTYPE #632

Merged
merged 1 commit into from
Jul 10, 2023

Commits on Jul 10, 2023

  1. Factory for SAXParser parsing XML without DOCTYPE

    External entity resolution is not supported by PDE (see
    PDECoreMessages.XMLErrorReporter_ExternalEntityResolution) but still the
    SAXParser did follow external links where DefaultHandler.resolveEntity
    was not overwritten.
    At many places PDE already overwrote DefaultHandler.resolveEntity to
    prevent external resolution. With the new configuration that method is
    not even called anymore.
    
    This change offers and uses a configuration that
    * reports an Exception if .xml contains DOCTYPE or
    * does just ignore external references (as a fall back if the exception
    would show up to cause trouble).
    
    Also the caching of used parsers in possibly other threads is removed
    because the SAXParser is not guaranteed to be thread-safe. Only the
    factory is reused, because that is effectively final after creation.
    Reusing SAXParser is not a big help nowadays - see
    XmlParserFactoryTest.main(String[]) for performance test.
    In my measurement successive parser creations takes only ~ 0.06 ms.
    EcljpseB0T committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    377b2a4 View commit details
    Browse the repository at this point in the history