[XML-SIG] [ pyxml-Bugs-696457 ] public/system ID swapped

SourceForge.net noreply@sourceforge.net
Mon, 03 Mar 2003 02:12:44 -0800


Bugs item #696457, was opened at 2003-03-03 11:12
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=696457&group_id=6473

Category: DOM
Group: None
Status: Open
Resolution: None
Priority: 6
Submitted By: Alexandre Fayolle (afayolle)
Assigned to: Nobody/Anonymous (nobody)
Summary: public/system ID swapped 

Initial Comment:
I received this on the Debian bug tracker:
-------------------------------------------8<------------------------------
Hello,

I found a really annoying bug in the Sax2 reader from
xml.dom.ext.reader.  It exchanges the public identifier
and system
identifier of the Document Type Declaration.

The problem can be reproduced with the following Python
script.

== "saxerror.py" starts at following line  ===============
#! /usr/bin/env python   

import xml.dom
from xml.dom.ext.reader import Sax2

reader = Sax2.Reader()
doc=reader.fromString("""<?xml version="1.0" ?>
<!DOCTYPE kasten PUBLIC "-//Jochen Voss//DTD Zettel
1.0//EN" "zettel.dtd">
<kasten>
</kasten>
""")
for c in doc.childNodes:
    if c.nodeType==xml.dom.Node.DOCUMENT_TYPE_NODE:
        print "public ID: "+c.publicId
        print "system ID: "+c.systemId
== "saxerror.py" ends at previous line
=============================

When I run this script I get the following output:

    voss@tatonka [~/src/app/zettel] ./saxerror.py
    public ID: zettel.dtd
    system ID: -//Jochen Voss//DTD Zettel 1.0//EN

note that the public and system ID are exchanged.

The same effect occurs while parsing file contents
instead of a
string.  This is especially annoying because reading
and then writing
a XML file will damage it by exchanging the IDs.

I hope this helps,

Jochen


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

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