alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files
MIT License
536 stars 134 forks source link

Fail to ident files with empty namespace #10

Closed kimus closed 11 years ago

kimus commented 12 years ago

ex: <a xmlns=""><b></b></a>

Traceback (most recent call last): File ".\sublimeplugin.py", line 350, in run File ".\indentxml.py", line 37, in run File ".\indentxml.py", line 48, in indentxml File ".\xml\dom\minidom.py", line 57, in toprettyxml File ".\xml\dom\minidom.py", line 1749, in writexml File ".\xml\dom\minidom.py", line 812, in writexml File ".\xml\dom\minidom.py", line 301, in _write_data AttributeError: 'NoneType' object has no attribute 'replace'

alek-sys commented 11 years ago

According to XML spec at http://www.w3.org/TR/REC-xml-names/#iri-use 2.2 Use of URIs as Namespace Names The empty string, though it is a legal URI reference, cannot be used as a namespace name.

So XML with empty namespace cannot be correctly parsed by minidom module