W3C home > Mailing lists > Public > www-archive@w3.org > October 2004

XML::LibXML fails to load SGML catalogs

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 03 Oct 2004 06:01:47 +0200
To: perl-xml@listserv.ActiveState.com
Message-ID: <4178636c.232336972@smtp.bjoern.hoehrmann.de>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:46 GMT