The xmlresolver project provides an implementation of the System.Xml.XmlResolver. It uses the OASIS XML Catalogs V1.1 Standard to provide a mapping from external identifiers and URIs to local resources.
$ dotnet add package XmlResolverA C# implementation of the XML Resolver.
This package implements an OASIS catalog-based XML resource resolver.
See The XML Resolver Project for more details.
This API implements System.Xml.XmlResolver.
The resolver can read catalogs from the local filesystem, from ZIP files, or from assemblies bundled with your application.
Version 6.x is a significant refactoring and is not backwards compatible with version 2.x. (The underlying functionality is the same, but the API is different.) The version 2.x sources are now in the legacy_v2 branch. Important bug fixes will be applied to the 2.x release for some time, but new development is focused on the 6.x release.
Three main considerations drove the refactoring:
XmlResolver.XmlResolver… and not Org.XmlResolver….Where previously you would have instantiated an
Org.Xmlresolver.Resolver and used it as the entity resolver for System.Xml.XmlResolver
you should now instantiate an XmlResolver.XmlResolver. This new object has methods for
performing catalog lookup and resource resolution. It also has a method that
returns the System.Xml.XmlResolver resolver API:
XmlResolver.XmlResolver.getXmlResolver()
Behind the scenes, the API has been reworked so that most operations
consist of constructing a request for some resource, asking the XmlResolver to either
(just) look it up in the catalog or resolve it, and returning a response.
This release fixes a bug in how assembly catalogs are located, updates
the release to use .NET 8, and replaces the now deprecated WebClient
API with the System.Net.Http URI.