NAME
XML::Catalog - Resolve public identifiers and remap system identifiers
SYNOPSIS
use XML::Catalog;
my $catalog=XML::Catalog->new('/xml/catalog.cat');
$catalog->add('http://www.w3.org/xcatalog/mastercat.xml');
my $sysid=$catalog->resolve_public('-//John Cowan//LOC Diacritics');
my $newsysid=$catalog->remap_system('http://www.w3.org');
DESCRIPTION
This module implements draft 0.4 of John Cowan's XML Catalog (formerly known as XCatalog) proposal (<http://www.ccil.org/~cowan/XML/XCatalog.html>). Catalogs may be written in either SOCAT or XML syntax (see the proposal for syntax details); XML::Catalog will assume SOCAT syntax if the catalog is not in well-formed XML syntax.
CONSTRUCTOR
- new(URL [,URL]*)
-
Read the catalog identified by URL and return a catalog object implementing it. If more than one URL is given, chain the additional catalogs as extensions to the catalog (they will be searched before catalogs specified by EXTEND entries).
All URLs must be absolute. A URL with no protocol is treated as a filename.
METHODS
- add(URL [,URL]*)
-
Chain the catalogs identified by the URL(s) to the current catalog.
- resolve_public(PUBID)
-
Translate the public identifier PUBID to a system identifier. Returns undef if the identifier could not be translated.
- remap_system(SYSID)
-
Remap the system identifier SYSID as specified by the catalog. Returns SYSID unchanged if no remapping was found.
BUGS / TODO
Searching of chained catalogs is not purely depth-first (EXTEND items in a chained catalog will be searched before EXTEND items in the original catalog.
Error checking leaves much to be desired.
AUTHOR
Eric Bohlman (ebohlman@netcom.com)
COPYRIGHT
Copyright 1999 Eric Bohlman. All rights reserved.
This program is free software; you can use/modify/redistribute it under the same terms as Perl itself.