xmlresolver / xmlresolvercs

A C# implementation of the XML Resolver
Other
4 stars 3 forks source link

The System.Xml bug that causes public identifiers treated as relative URIs has catastrophic performance implications #25

Closed ndw closed 2 years ago

ndw commented 2 years ago

When System.Xml encounters a public identifier, it constructs a $DEITY awful mangled URI for it, for example:

http://example.com/path/-//DTD//Example 1.0//EN

That's not going to be found in the catalog.

Because it isn't found in the catalog, the resolver has no choice but to attempt to retrieve it. So every public identifier delays the parser by the length of time it takes to make a failed HTTP round trip.

The XmlResolver should work harder to recognize these broken URIs and do public ID lookup for the public identifier.