[XML-SIG] Processing of External Unparsed Entities

W. Eliot Kimber eliot@isogen.com
Thu, 26 Apr 2001 20:16:18 -0500


"W. Eliot Kimber" wrote:
> 
> The code for processing external unparsed entities appears to be broken
> in the current code, both in DOM1 and DOM2 (I am currently using DOM1 to
> do development). Has anyone exercised this or tested it? Should it be
> working? I'm looking at the latest code off the SourceForge CVS tree.

I had to do more work to get all the entity and notation processing for
unparsed entities working correctly with the Sax2 parser and drivers. (I
haven't tried to fix the Sax 1 stuff because it doesn't correctly handle
resolving relative system ID paths, so I can't use it anyway.) I also
had to fix attribute lookup using getNamedItem on Element.

I've touched the following files:

dom/DOMImplementation.py
dom/Document.py
dom/DocumentType.py
dom/Element.py
dom/Entity.py
dom/ext/reader/Sax2.py

The problems I found were:

- Orphaned unparsed entity and notation declarations were not getting
properly set with the owning document.
- Added createEntity to XmlDomGenerator (it was being called from Sax
driver but hadn't been implemented)
- Unparsed entities were not be constructed with a useful nodeName
value.
- lookup of attributes on NamedNodeList failed when using getAttribute()
because in Sax2 the keys are (Uri, name) but the code was only passing
in name. I hacked it by passing in (None, name) from getAttribute on
Element.

I have no idea if any of these fixes are appropriate, I just hacked it
until my document parsed and my particular application got the data it
wanted.

Please let me know how I should proceed with testing these changes and
contributing them back.

Thanks,

Eliot
-- 
. . . . . . . . . . . . . . . . . . . . . . . .

W. Eliot Kimber | Lead Brain

1016 La Posada Dr. | Suite 240 | Austin TX  78752
    T 512.656.4139 |  F 512.419.1860 | eliot@isogen.com

w w w . d a t a c h a n n e l . c o m