[Home] [By Thread] [By Date] [Recent Entries]

  • From: Clark Cooper <coopercc@n...>
  • To: perl-xml@l...
  • Date: Sat, 24 Jul 1999 12:15:02 -0400


Ken Beesley <ken.beesley@x...>, 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@n...
			Schenectady, NY	USA	Work:   cccooper@l...

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
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@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member