OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] RE: Compelling use case for XML Catalogs?

Hi Folks,

Thank you for the excellent feedback. Below is a summary of what I learned. Please let me know of any errors.  /Roger


An XML Catalog is a file that describes the mapping from URLs to local resources. An XML Catalog tool does the conversion of the URLs in XML documents.

Consider this scenario: 

1. Your system has just received an XML document (either because someone sent it to you, or because you fetched it).

2. The XML document contains URLs.

3. The system sends the XML document into an XML Catalog tool.

If the XML document contains a URL that is specified in the XML Catalog then the URL will be mapped to a different resource, as specified by the XML Catalog.

If the XML document contains a URL that is not specified in the XML Catalog then the URL will be unchanged.

The most common usage of XML Catalog is to map the URL specified in an XHTML DOCTYPE declaration to a local DTD.

XML Catalog cannot be used to test that the XML document contains expected or allowed URLs, i.e., an XML Catalog tool is not a URL validator. 

If it is necessary to validate the URLs then XML Catalog must be supplemented  with something else.

In a disconnected environment (i.e., no network access) the system designer will typically have already configured XML documents to use local resources. Thus, XML Catalog will not be useful in that environment.

XML Catalog can assist with portability: if the XML document has URLs to resources on one network, then when the document is shipped to another network an XML Catalog can map the URLs to that networks' resources.

The kinds of URLs that may be mapped in an XML Catalog include:
     - URLs in DOCTYPEs
     - URLS in XML external entities
     - URLs in namespaces

Recap: If an incoming XML document has a known set of URLs that need to be converted/mapped to another set of URLs then XML Catalog can do that. 

"Hello World" example: an XML Catalog is used to map the URL specified in an XHTML DOCTYPE declaration to a local DTD. Here is a sample XHTML document:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml";>

	<title>An XHTML 1.0 Strict standard template</title>
	<meta http-equiv="content-type" 
		content="text/html;charset=utf-8" />


         <p>... Your HTML content here ...</p>


Below is an XML Catalog that maps this URL:


to a local DTD:


Here is the XML Catalog that does this mapping:

<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

    <uri name="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"; 
           uri=" local-strict.dtd"/>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS