XML::Catalogs::HTML - Catalog of HTML and XHTML DTDs
Version 1.8.0
use XML::Catalogs::HTML -libxml; --- use XML::Catalogs::HTML; XML::Catalogs::HTML->notify_libxml(); --- use XML::Catalogs::HTML; my $url = XML::Catalogs::HTML->get_catalog_url(); my $path = XML::Catalogs::HTML->get_catalog_path();
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 catalog of HTML and XHTML DTDs in case they are not 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.
Currently, only the DTDs for HTML 4.01 and XHTML 1.0 are included in this distribution. Please let me know if you need earlier versions.
use XML::Catalogs::HTML -libxml
This loads XML::Catalogs::HTML and calls XML::Catalogs::HTML->notify_libxml()
XML::Catalogs::HTML->notify_libxml()
This method informs XML::LibXML of this catalog. XML::LibXML will use the local DTDs when parsing HTML and XHTML documents. This only affects the current process.
To have any effect, XML::LibXML's load_ext_dtd => 1 option must be used.
load_ext_dtd => 1
This mechanism does not stop working when XML::LibXML's no_network => 1 option is used.
no_network => 1
Note that XML::LibXML version 1.53 is required for this features.
XML::Catalogs::HTML->get_catalog_url()
Returns a file:// URL to the catalog.
XML::Catalogs::HTML->get_catalog_path()
Returns the file path of the catalog.
http://en.wikipedia.org/wiki/XML_Catalog, Wikipedia's entry on XML Catalogs.
XML::LibXML, an excellent XML parser that supports catalogs.
XML::Catalogs, this module's base class.
HTML::DTD, an alternate source for HTML and XHTML DTDs.
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.
Please report any bugs or feature requests using https://github.com/ikegami/perl-XML-Catalogs-HTML/issues. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc XML::Catalogs::HTML
You can also find it online at this location:
https://metacpan.org/dist/XML-Catalogs-HTML
If you need help, the following are great resources:
https://stackoverflow.com/|StackOverflow
http://www.perlmonks.org/|PerlMonks
You may also contact the author directly.
Web: https://github.com/ikegami/perl-XML-Catalogs-HTML
git: https://github.com/ikegami/perl-XML-Catalogs-HTML.git
Eric Brine, <ikegami@adaelis.com>
<ikegami@adaelis.com>
No rights reserved.
The author has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.
Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author.
To install XML::Catalogs::HTML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Catalogs::HTML
CPAN shell
perl -MCPAN -e shell install XML::Catalogs::HTML
For more information on module installation, please visit the detailed CPAN module installation guide.