[XML-SIG] namespace error - how to ignore

Uche Ogbuji uche.ogbuji at fourthought.com
Thu Aug 19 21:34:25 CEST 2004

On Mon, 2004-08-16 at 00:54, Ajay wrote:
> hi!
> i have the following code to create a a document
> ssock = StringIO.StringIO(inputString)
> reader = Sax2.Reader()
> doc = reader.fromStream(ssock)
> input string simply contains <appel:RULE></appel:RULE>
> when i run it, it throws a namespace error. i can understand where the
> error is coming from (i haven't defined the namespace), but is there a way
> to get past it? to get it to ignore the namespace?
> the same thing in Java works fine (without worrying about the namespace).

Sax.Reader is not namespace aware, so it should accept this.  However,
you're on the wrong trap:

1) Why are you trying to parse a document that is not XML namespace
compliant?  You'll have nothing but trouble.

2) I suggest not using 4DOM (i.e. xml.dom.ext.reader)

Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Decomposition, Process, Recomposition - http://www.xml.com/pub/a/2004/07/28/py-xml.html
Perspective on XML: Steady steps spell success with Google - http://www.adtmag.com/article.asp?id=9663
Managing XML libraries - http://www.adtmag.com/article.asp?id=9160
Commentary on "Objects. Encapsulation. XML?" - http://www.adtmag.com/article.asp?id=9090
Harold's Effective XML - http://www.ibm.com/developerworks/xml/library/x-think25.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/

More information about the XML-SIG mailing list