XML Catalogs

ajt on 2003-04-06T21:19:09

This weekend I started to read about how XML catalogs work in XML::LibXML/libxml2. If you parse an XML document with libxml2 and it refers to an external document, then it tries to find it for you. The problem is that if this resource is on the public Internet, and you are not, then it sits around for about a minute before giving up.

A long time ago I noticed that when working with some RSS documents my tool-kit would take an age to complete the page. The problem was caused by the libxml2 parser not being able to reach the Internet and taking a very long time to build the page.

So this weekend, I tried to give XML Catalogs ago to cache external DTDs. It turns out that it's quite easy to create a catalog, and load in a local DTD rather than a remote one, so I dutifully added it to my module, and added extra tests and documentation. I ran the tests connected to the Internet and then not connected, only to discover that I had largely fixed it already......