NAME
XML::Catalogs - Basic framework to provide DTD catalogs
VERSION
Version 1.0.1
SYNOPSIS
To make a catalog:
Use XML::Catalogs::HTML as an example
To use a catalog:
use XML::Catalogs::FOO -libxml;
---
use XML::Catalogs::FOO;
XML::Catalogs->notify_libxml();
---
use XML::Catalogs::FOO;
my $url = XML::Catalogs::FOO->get_catalog_url();
my $path = XML::Catalogs::FOO->get_catalog_path();
DESCRIPTION
To properly parse named entities in an XML document, the parser must have access to the XML subformat's DTDs.
XML::LibXML, for one, does not cache DTDs it downloads. Instead, it relies on them being in the system's XML catalog. This is not always configured properly for a number of reasons.
An XML catalog is simply a set of DTDs and a table of contents that associates DTD identifiers with the DTDs.
This module provides a simple framework to package XML catalogs. It also provides a simple method to notify XML::LibXML of DTDs that may not be present in the system's catalog.
It works on all platforms, it works without requiring root priviledges, and it works with CPAN's dependency system.
CLASS METHODS
use XML::Catalogs::FOO -libxml
-
This loads XML::Catalogs::FOO and calls
XML::Catalogs::FOO->notify_libxml()
$subclass->notify_libxml()
-
This method informs XML::LibXML of the subclass's catalog. XML::LibXML will use the local DTDs referenced by the catalog instead of downloading them. This only affects the current process.
This mechanism does not stop working when XML::LibXML's
->no_network(1)
option is used. When using that option, XML::LibXML refrains from downloading remote resources. $subclass->get_catalog_url()
-
Returns a file:// URL to the subclass's catalog.
$subclass->get_catalog_path()
-
Returns the file path of the subclass's catalog.
SEE ALSO
http://en.wikipedia.org/wiki/XML_Catalog, Wikipedia's entry on XML Catalogs.
XML::LibXML, an excellent XML parser that supports catalogs.
XML::Catalogs::HTML, a module using this framework.
http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic, An example of the real world effects of not having local DTDs.
BUGS
Please report any bugs or feature requests to bug-XML-Catalogs at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-Catalogs. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc XML::Catalogs
You can also look for information at:
Search CPAN
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
AUTHOR
Eric Brine, <ikegami@adaelis.com>
COPYRIGHT & LICENSE
Public domain. No rights reserved.