XML::LibXML fails to load SGML catalogs

Hi,

  E.g. using

  #!perl -w
  use strict;
  use warnings;
  use XML::LibXML;

  my $p = XML::LibXML->new( catalog => 'xml.soc');
  $p->parse_file('t.xhtml');
  
Where xml.soc is something like

  OVERRIDE YES
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "..."

Using XML::LibXML 1.54 the catalog is read and ignored, using 1.58 it
will read the t.xhtml, fetch the DTDs resources via HTTP and then state

  xml.soc:1: parser error : Start tag expected, '<' not found
  OVERRIDE YES
  ^

in the latter case with XML_DEBUG_CATALOG=1

  Resolve: pubID -//W3C//DTD XHTML 1.0 Strict//EN sysID http://www...
  Failed to parse catalog file:///C%3A/Perl/bin/../etc/catalog
  xml.soc:1: parser error : Start tag expected, '<' not found
  OVERRIDE YES
  ^
  Failed to parse catalog xml.soc
  ...

It's the same with libxml2-2.6.13 and XML-LibXML-1.58_1. It does not
seem to matter whether XML_CATALOG_FILES is set to something or not.

Hmm... Okay, it seems that not calling xmlInitializeCatalog() in the
XS BOOT solves this problem, this would also explain why xmllint has
not trouble loading the catalog as it does not xmlInitializeCatalog().
I am not sure whether this is a bug in XML::LibXML or libxml2...

regards.

Received on Sunday, 3 October 2004 04:02:39 UTC