Subject: | crates skipped entity (name [dtd]) at start_dtd |
crates skipped entity (name [dtd]) at start_dtd, which courses an
invalid page.
script
------
#!/usr/local/bin/perl -w
use XML::SAX;
use XML::SAX::Writer;
$XML::SAX::ParserPackage = "XML::SAX::ExpatXS (1.10)";
my $writer = XML::SAX::Writer->new();
my $parser = XML::SAX::ParserFactory->parser(Handler => $writer ) ;
#$parser->set_feature('http://xml.org/sax/features/external-parameter-entities',
1);
#$parser->set_feature('http://xml.org/sax/features/external-general-entities',
0);
$parser->parse_uri( shift @ARGV );
input file
-----------
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
</head>
<body>
<p>aa</p>
</body>
</html>
output
-------
vinita@cephalopod[/local/host/apps/webcms-dev/bin] ./xmlsaxtestt tmp/d.html
<?xml version='1.0' encoding='iso-8859-1' standalone='no'?><!DOCTYPE
html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' [
&[dtd]; ]><html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>test</title>
</head>
<body>
<p>aa</p>
</body>
</html>
see the extra "[
&[dtd]; ]
we didn't get this with version 1.08.
Thanks
vinita