[XML-SIG] binding an unbound namespace prefix

Andrew Clover and-xml at doxdesk.com
Wed Dec 24 05:22:03 EST 2003

Keith Beattie <KSBeattie at lbl.gov> wrote:

> How do I pass the namespaces into minidom.parseString(), or
> Domlette.NonvalidatingReader.parseString(), such that they'll be happy
> with the 'unbound prefix'?

I know of no convenient way of doing this with either minidom or domlette.
Probably the quickest solution is to hack the input content so it's
surrounded with an element declaring all the known namespaces, then ignore
the root element of the result.

Alternatively, the DOM Level 3 method parseWithContext would let you insert
directly into the relevant part of the document (with namespaces declared
above). pxdom supports this method and the domConfig parameter
'canonical-form', so that might be a possibility too.

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list