alek-sys / sublimetext_indentxml

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

Doesn't support xsi:type attributes #11

Closed obec closed 12 years ago

obec commented 12 years ago

Example:

<?xml version="1.0" encoding="UTF-8"?><root type="tag"><properties><property name="namespace" xsi:type="xsd:string">config</property></properties></root>

Causes:

Traceback (most recent call last): File ".\sublimeplugin.py", line 362, in run File ".\indentxml.py", line 32, in run File ".\indentxml.py", line 48, in indentxml File ".\xml\dom\minidom.py", line 1928, in parseString File ".\xml\dom\expatbuilder.py", line 940, in parseString File ".\xml\dom\expatbuilder.py", line 223, in parseString xml.parsers.expat.ExpatError: unbound prefix: line 1, column 67

alek-sys commented 12 years ago

Could you please provide full example? Something like <?xml version="1.0" encoding="UTF-8"?> works ok, probably problem with undeclared namespaces.

obec commented 12 years ago

Sorry, it was cutting my example off and processing the XML. I updated the body with a code block.

alek-sys commented 12 years ago

I don't think it is a bug. Technically xml you provided is not well-formed - namespaces xsi and xsd are not defined. If you update it like <?xml version="1.0" encoding="UTF-8"?>config plugin will work. Not sure if formatting can be done for invalid xml files, so I assume it's not a bug.