alek-sys / sublimetext_indentxml

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

Can't get it to work on Sublime Text 3 #84

Closed davellan closed 8 years ago

davellan commented 8 years ago

I downloaded the zip file from GitHub and unzipped it to my C:\Users\Username\AppData\Roaming\Sublime Text 3\ Packages folder, putting the files into a folder called*IndentXML.

I opened SublimeText 3 and when I look for commands I see that there are two Inden tXML and two Indent JSON listed.

Whichever one I choose does nothing, and these errors appear in console:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 556, in run_
    return self.run(edit)
  File "C:\Users\Username\AppData\Roaming\Sublime Text 3\Packages\IndentXML\indentxml.py", line 51, in run
    s = self.indent(s)
  File "C:\Users\Username\AppData\Roaming\Sublime Text 3\Packages\IndentXML\indentxml.py", line 100, in indent
    raise e
  File "C:\Users\Username\AppData\Roaming\Sublime Text 3\Packages\IndentXML\indentxml.py", line 97, in indent
    s = parseString(s).toprettyxml()
  File "./xml/dom/minidom.py", line 1970, in parseString
  File "./xml/dom/expatbuilder.py", line 926, in parseString
  File "./xml/dom/expatbuilder.py", line 221, in parseString
xml.parsers.expat.ExpatError: syntax error: line 1, column 0

How do I get this to be fixed?

alek-sys commented 8 years ago

Hi, Recommended way to install the plugin is using Package Control. Regarding the error you got - this is something specific to XML you are trying to parse, it is hard to say without XML itself. Make sure this is a valid XML file (you can try any online validator (http://www.w3schools.com/xml/xml_validator.asp).

davellan commented 8 years ago

alek-sys, I have sublime text 3 and in your own instructions it says to install manually. I have tried through package control and it does not appear.

However, you were correct there was some malformed element that once removed allowed auto-indent to work. Thanks!