Skip Menu |

This queue is for tickets about the XML-SAX-ExpatXS CPAN distribution.

Report information
The Basics
Id: 18546
Status: resolved
Priority: 0/
Queue: XML-SAX-ExpatXS

People
Owner: PCIMPRICH [...] cpan.org
Requestors: vinita [...] csse.unimelb.edu.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.10
Fixed in: (no value)



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
I think this behavior is correct, as for XML::SAX::ExpatXS parser. The skippedEntity handler has been implemented In v1.10, this why it changed from v1.08. It is supposed to notify about skipped entites, including external DTD subsets. See http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String) for details about how it should work in SAX. The problem is that XML::SAX::Writer writes this pseudo-entity out, which is clearly not what you want in this case. I will try to provide a patch for XML::SAX::Writer.
Will be fixed with upcoming XML::SAX::Writer 0.50
Not valid. The issue was related to XML::SAX::Writer and has already been fixed.