[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] RE: Compelling use case for XML Catalogs?
- From: "Costello, Roger L." <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Mon, 13 Jun 2011 15:46:18 -0400
Excellent feedback from Tony Lavinio:
- They [the URLs specified in an XML Catalog] don't have to be local. They can just be alternate.
- Often they are used to increase performance, by bringing a remote resource local.
- They are also used when the remote resource throttles, as W3C has to. They were receiving 100 million DTD requests/day. See http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic/
- A catalog resolver is just a specific type of URI resolver.
- Norm Walsh wrote a good article on them called "If You Can Name It You Can Claim it!" at http://www.arbortext.com/html/issue_three.html. I think that link is gone; there is a cached copy at http://www.stylusstudio.com/cached/catalogs/issue_three.html.
--
Tony Lavinio
-----Original Message-----
From: Costello, Roger L.
Sent: Monday, June 13, 2011 2:28 PM
To: xml-dev@lists.xml.org
Subject: 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
SUMMARY
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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An XHTML 1.0 Strict standard template</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
</head>
<body>
<p>... Your HTML content here ...</p>
</body>
</html>
Below is an XML Catalog that maps this URL:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
to a local DTD:
local-strict.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"/>
</catalog>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]