[XML-SIG] DOM handling with parsed element

Thomas B. Passin tpassin@home.com
Fri, 14 Dec 2001 10:08:38 -0500


[Alexandre Fayolle]

> On Thu, 13 Dec 2001, Thomas B. Passin wrote:
>
> > Presumably in the next release of pyxml, all these NS functions will
require
> > None instead of '' for a missing namespace.
>
> 2 things :
>  * in the next release of PyXML, the non NS methods of 4DOM will delegate
> the call to the NS methods with None as the namespace uri, so this should
> be the end of the nightmare.

A most excellent move!

>  * right now, a good way of writing code that won't require any changes
> when upgrading to PyXML-0.7 is
>
> try:
>     from xml.dom import EMPTY_NAMESPACE
> except:
>     EMPTY_NAMESPACE = ''
>
> and then use
> elt.getAttributeNS(EMPTY_NAMESPACE,'foo')
>
> This supposes that pyexpat has been used to build the DOM, which is the
> default. With validation enabled, you have to set EMPTY_NAMESPACE to None.
>

What if someone wants to use a different parser?  What's the situation
there?

Cheers,

Tom P