Bug in XML::Parser declaration handling

Clark Cooper coopercc at netheaven.com
Sat Jul 24 18:28:09 BST 1999


Ken Beesley <ken.beesley at xrce.xerox.com>, discovered that, in Version 2.25
of XML::Parser, the Attlist and Element handlers aren't being called
for declarations in the external DTD when there is no internal subset.

So, for example, given these files:

junk.dtd:
  <!ATTLIST foo bar CDATA 'junk'>

junk.xml>
  <!DOCTYPE foo SYSTEM 'junk.dtd'>
  <foo/>

junk2.xml:
  <!DOCTYPE foo SYSTEM 'junk.dtd' []>
  <foo/>

This script:
################
use XML::Parser;
$p = new XML::Parser(ParseParamEnt => 1,
                     Handlers => {Start => sub {shift; print "Start: @_\n"},
                                  Attlist => sub {shift; print "Att: @_\n"}});
$p->parsefile('junk.xml');
print "--Next File--\n";
$p->parsefile('junk2.xml');
################

produces this output:
================
Start: foo bar junk
--Next File--
Att: foo bar CDATA 'junk'
Start: foo bar junk
================

So, until I get this bug fixed, a workaround is to put in an empty internal
subset as necessary.

-- 
Clark Cooper		Software Engineer	Home:   coopercc at netheaven.com
			Schenectady, NY	USA	Work:   cccooper at ltionline.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list