Search This Blog

Saturday, February 2, 2008

OASIS XML Catalogs for .NET and Mono

An XML-DEV posting from Anthony B. Coates (Miley Watts LLP) reports on
the availability of "OASIS XML Catalogs for .NET and Mono." The
software is distributed under the Apache License, Version 2.0. XML
documents sometimes need to refer to other documents, particular
Schemas or DTDs. While DTDs allow can be referenced using logical
(non-physical) names (public IDs), W3C XML Schemas are typically
referred to using a relative or absolute URL (which could be a "file:"
URL, equivalent to a file path). There are often problems with this
in practice. First, different users may not have access to the same
files in the same locations; even an HTTP URL may refer to a private
system that not all users have access to. Second, you may not trust
the Schema (etc.) references in incoming XML files. Thus, the OASIS
XML Catalogs specification defines a standard XML format for mapping
URIs in XML documents to your own local, trusted copies of Schemas,
etc. The .NET/Mono API provides an XmlResolver class that convert a
relative URL into an absolute URL. Miley Watts XML Catalogs for .NET
and Mono provides a (derived) replacement class "XmlCatalogResolver"
which reads an XML Catalog file and uses the catalog mappings to
rewrite the URIs as appropriate. This allows you to redirect any URI
that is passed to the XML resolver by the XML parser. Key benefits:
(1) Increases security and flexibility for XML applications by
allowing any URI to be mapped to a local copy of a file -- Schema or
other; (2) Can also map to from one URI to another, not just from
URIs to local files; (3) Implements a standard for URI mapping -
OASIS XML Catalogs; (4) Integrates with existing .NET/Mono XML API;
(5) Royalty-free and open source; all source code is provided. The
current implementation is focused on the needs of .NET/Mono users
who use W3C XML Schemas. For this reason, the following features
from OASIS XML Catalogs are not currently supported: (i) "publicid"
URNs as an alternative format for PUBLIC IDs; (ii) "delegatePublic"
declarations; (iii) "delegateSystem" declarations; (iv) "delegateURI"
declarations.

No comments: