Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: minidom toxml() not emitting attribute namespace qualifier

Reply
Thread Tools

Re: minidom toxml() not emitting attribute namespace qualifier

 
 
Paul Boddie
Guest
Posts: n/a
 
      06-24-2003
Alan Kennedy <> wrote in message news:<>...
> kevin wrote:
>
> > Using Python 2.2.3, with this example code:

>
> [Code elided]


See my results below.

> > The output is missing the "myns" namespace qualifier on the "att"
> > attribute. Can someone tell me what I'm doing wrong?

>
> That's a bug in minidom.


Not any more, apparently - see below.

> I reported it back in November 2002, but I wasn't precise enough about version
> numbers, so it went unaddressed.
>
> https://sourceforge.net/tracker/?func=detail&atid=106473&aid=637355&group_id=6473
>
> I will update that bug report now that I can see for sure that the bug is
> still present in 2.2.3.


Well, it was definitely there in the 2.1 series, but as my recently
added comment on SourceForge suggests, I think it has been resolved in
recent minidom implementations. Certainly, I don't think that my
particular installation of Python (Cygwin, Windows 2000, Python 2.2.3)
has any additional modifications, and yet...

>>> import xml.dom.minidom
>>> XML = """\

.... <?xml version="1.0"?>
.... <elem xmlns:myns="mynamespaceuri" myns:att="value"/>
.... """
>>> dom = xml.dom.minidom.parseString( XML )
>>> print dom.toxml()

<?xml version="1.0" ?>
<elem myns:att="value" xmlns:myns="mynamespaceuri"/>

Am I missing something or is this not what one would expect?

Paul
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xml.dom.minidom losing the XML document type attribute Johannes Bauer Python 7 06-11-2009 10:21 PM
Replacing _xmlplus.dom.minidom with xml.dom.minidom aine_canby@yahoo.com Python 3 08-03-2007 03:50 PM
Empty string namespace on XP in minidom Gary Python 0 07-07-2007 11:31 AM
Client side validators not emitting John Livermore ASP .Net 1 07-18-2003 09:03 PM
Re: Emitting &nbsp; to HTML Output Klaus Johannes Rusch XML 5 06-27-2003 09:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57