This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author karlcow
Recipients BreamoreBoy, Steve.Romanow, bernie9998, hda, karlcow, nneonneo, sechi_francesco
Date 2010-10-14.23:28:28
SpamBayes Score 0.0010070937
Marked as misclassified No
Message-id <1287098911.44.0.0149945785957.issue5762@psf.upfronthosting.co.za>
In-reply-to
Content
This following markup creates the mistake as described earlier in the comments

<element xmlns="">
<b class="foo" alt=""/>
</element>

This markup doesn't

<element xmlns="bla">
<b class="foo" alt=""/>
</element>

It returns

<?xml version="1.0" ?><element xmlns="bla">
<b alt="" class="foo"/>
</element>

When using this markup

<element bar="">
<b class="foo" alt=""/>
</element>

It outputs the right markup,

<?xml version="1.0" ?><element bar="">
<b alt="" class="foo"/>
</element>

So the mistake occurs really when xmlns="".  I have checked and the following markup is a conformant markup according to the XML specification so xmlns="" or bar="" are conformant on the root element.

<element xmlns="">
<b class="foo" alt=""/>
</element>

XML Namespaces are defined in another specification. http://www.w3.org/TR/REC-xml-names/. In the section of Namespaces default http://www.w3.org/TR/REC-xml-names/#defaulting, The specification is clear.

"The attribute value in a default namespace declaration MAY be empty. This has the same effect, within the scope of the declaration, of there being no default namespace."

the proposed "if data:" earlier in the comment solves the issue. I have attached a unit testcase as required by Mark Lawrence (BreamoreBoy)
History
Date User Action Args
2010-10-14 23:28:31karlcowsetrecipients: + karlcow, nneonneo, hda, sechi_francesco, Steve.Romanow, BreamoreBoy, bernie9998
2010-10-14 23:28:31karlcowsetmessageid: <1287098911.44.0.0149945785957.issue5762@psf.upfronthosting.co.za>
2010-10-14 23:28:30karlcowlinkissue5762 messages
2010-10-14 23:28:29karlcowcreate