[XML-SIG] [ pyxml-Bugs-603322 ] The SAX (1) driver does not report &

noreply@sourceforge.net noreply@sourceforge.net
Sun, 01 Sep 2002 19:54:11 -0700


Bugs item #603322, was opened at 2002-09-01 19:54
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=603322&group_id=6473

Category: SAX
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: The SAX (1) driver does not report &

Initial Comment:
Trying to make ns_parse from XBEL work, I found that
the SAX driver for sgmlop is not reporting entity and
character references (specifically & and *,
which are the ones I tried).  The driver for sgmllib
does report them.

I am using pyxml 0.7 with python 2.1.3 on WIn2000.

Here is a small file that demonstrates the behavior

from xml.sax import saxexts,saxlib
from StringIO import StringIO

class test_handler(saxlib.HandlerBase):
    def __init__(self):
        pass
    
    def startElement(self,name,attrs):
        print 'Start Element: %s ' % name

    def characters(self,data,start,length):
        print '--->'
        print data[start:start+length]
        print '<---'

    def endElement(self,name):
        print 'End Element: ',name
        
html='''<body>
    <p>first&amp;second</p>
</body>
'''

thefile=StringIO(html)

if __name__ == '__main__':
    print '============'
    h=test_handler()
    p=saxexts.SGMLParserFactory.make_parser()
    p.setDocumentHandler(h)
    p.parseFile( thefile )
:

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=603322&group_id=6473