Subject: | problem with attribute type in doctype declaration (DTD) |
When parsing my test XML file, the parser generates an error and
doesn't produce attribute type #REQUIRED
The following is the output of the test case.
$ ./dtd-bug.pl
<?xml version='1.0'?><!DOCTYPE test [
<!ELEMENT xsl:stylesheet ANY >
Use of uninitialized value in concatenation (.) or string
at /usr/lib/perl5/site_perl/5.8.5/XML/SAX/Writer/XML.pm line 303.
<!ATTLIST xsl:stylesheet id ID >
]><?xml-stylesheet type="text/xsl" href="#stylesheet"?><test>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0' id='stylesheet' />
</test>
Subject: | dtd-bug.pl |
#!/usr/bin/perl -w
use strict;
use XML::SAX::ExpatXS;
use XML::SAX::Writer;
my $input = << '__THEEND__';
<?xml version="1.0"?>
<!DOCTYPE test [
<!ELEMENT xsl:stylesheet ANY>
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<?xml-stylesheet type="text/xsl" href="#stylesheet"?>
<test>
<xsl:stylesheet
version="1.0" id="stylesheet"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
</test>
__THEEND__
XML::SAX::ExpatXS
-> new(Handler => XML::SAX::Writer->new())
-> parse_string($input);