Re: minidom toxml() not emitting attribute namespace qualifier

Discussion in 'Python' started by Paul Boddie, Jun 24, 2003.

  1. Paul Boddie

    Paul Boddie Guest

    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
     
    Paul Boddie, Jun 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Hefferon

    doc.toxml() gives ASCII encoding error

    Jim Hefferon, Feb 18, 2004, in forum: Python
    Replies:
    2
    Views:
    758
    Jim Hefferon
    Feb 19, 2004
  2. Ray
    Replies:
    3
    Views:
    961
  3. Manuel Ospina

    tag replacement in toxml()

    Manuel Ospina, Apr 1, 2007, in forum: Python
    Replies:
    1
    Views:
    369
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 1, 2007
  4. Replies:
    3
    Views:
    559
    Stefan Behnel
    Aug 3, 2007
  5. Ron Vecchi

    Custom Class ToXml(), FromXml() methods

    Ron Vecchi, Jun 25, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    150
    Ron Vecchi
    Jun 28, 2004
Loading...

Share This Page