[XML-SIG] Bug in 0.6.6

Juergen Hermann Juergen Hermann" <jhe@webde-ag.de
Mon, 27 Aug 2001 18:19:33 +0200


On 27 Aug 2001 16:14:00 +0200, Lars Marius Garshol wrote:

>
>Hi J=FCrgen,
>
>* Juergen Hermann
>| 
>| I think I reported the following for 0.6.5, and it's still in 0.6.6. =

>| Can someone test this against the CVS source?
>
>I tested it now and got no problems. I seem to recall seeing this bug
>report before, and testing it with no problems then as well.

That's right. I guess we were already past 0.6.6 at that time, or at lea=
st 
the HEAD revision was.

>Could you test this against the CVS sources, or against PyXML 0.7.0?

Testing against the CVS head resolved THIS problem, and revealed another=
 
one. ;)

Can you test the following, and if it fails for you, I'll open a bug.

When I run "enttest", I get a traceback:

xml.sax._exceptions.SAXParseException: 
file:///export/home/jhe/tmp/EntityTest/subdtd/enttest.xml:2:37: Multiple=
 
text declarations in a single entity 

The problem is the nested parameter entity in the DTD. Xerces 1.4 parses=
 it 
w/o any problem.

=3D=3D> enttest.xml <=3D=3D
<?xml version=3D"1.0" encoding=3D"ISO-8859-1" standalone=3D"no"?>
<!DOCTYPE root SYSTEM "enttest.dtd">
<root/>

=3D=3D> enttest.dtd <=3D=3D
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>

<!ENTITY % subEntity SYSTEM "enttest-subdtd.ent">
%subEntity;

=3D=3D> enttest-subdtd.ent <=3D=3D
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
<!ELEMENT root EMPTY>

=3D=3D> enttest.py <=3D=3D
import os
import xml.sax
import xml.sax.saxutils
import xml.sax.handler
import xml.sax.sax2exts

class TestLoader(xml.sax.saxutils.DefaultHandler):

    def __init__(self, filename):
        self.fileurl =3D 'file://' + os.path.abspath(filename)

        # create parser
        parser =3D xml.sax.sax2exts.XMLValParserFactory.make_parser()
        print '+++ parser is', parser
        parser.setFeature(xml.sax.handler.feature_namespaces, 1)
        parser.setFeature(xml.sax.handler.feature_validation, 0)
        parser.setFeature(xml.sax.handler.feature_external_ges, 1)
        parser.setFeature(xml.sax.handler.feature_external_pes, 1)

        # set handlers
        parser.setContentHandler(self)
        parser.setDTDHandler(self)
        parser.setErrorHandler(self)
        parser.setEntityResolver(self)

        # parse the XML into events
        parser.parse(self.fileurl)

    def startElementNS(self, name, qname, attrs):
        print name, qname, attrs.items()


if __name__ =3D=3D "__main__":
    print xml.version_info
    test =3D TestLoader('enttest.xml')