alek-sys / sublimetext_indentxml

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

xml.parsers.expat.ExpatError: mismatched tag #43

Open MrBuBBLs opened 10 years ago

MrBuBBLs commented 10 years ago

It fails to indent the XML (RSS) that comes from here : Does the indentation really ignores whats in CDATA ?

Here's the error that I get :

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./indentxml.py", line 49, in run
  File "./indentxml.py", line 96, in indent
xml.parsers.expat.ExpatError: mismatched tag: line 1, column 1006

Here is the piece of XML (or you can get it from the link in top of this issue report)

<?xml version="1.0" encoding="ISO-8859-1" ?><?xml-stylesheet type="text/xsl" href="http://www.rssweather.com/xslt.php" ?><?xml-stylesheet type="text/css" href="http://www.rssweather.com/rss.css" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Paris, FRANCE Weather</title><link>http://www.rssweather.com/hw3.php?place=paris&amp;state=&amp;country=fr&amp;utm_source=rss&amp;utm_medium=rss</link><description><![CDATA[Current weather, forecasts and alerts delivered using RSS.<p>The weather information for this RSS feed is taken from the National Weather Service (http://weather.noaa.gov/), and powered by HamWeather (http://www.hamweather.com/). </p><h2>Using the Feeds</h2><ul><li>Request Frequency - The feeds are updated once per hour. More frequent requests may result in your access being limited.</li><li>Web Site Usage - If you are using the feed on your web site, you are required to maintain a link to rssWeather.com and hamweather.com</li></ul></b></p>]]></description><ttl>60</ttl><generator>HamWeather (http://www.hamweather.com/)</generator><language>en</language><item><title>Paris, FRANCE Weather :: 25C Fair</title><link>http://www.rssweather.com/hw3.php?place=paris&amp;state=&amp;country=fr&amp;utm_source=rss&amp;utm_medium=rss</link><category>Current Conditions</category><pubDate>Thu, 25 Jul 2013 10:00:00 +0100</pubDate><description>25C Fair</description><content:encoded><![CDATA[<h4><a href="http://www.rssweather.com/hw3.php?place=paris&amp;state=&amp;country=fr&amp;utm_source=rss&amp;utm_medium=rss" title="Paris, FRANCE Weather weather forecast"><img src="http://www.rssweather.net/images/fcicons/fair.gif" alt="fair" class="icon" width="55" height="58" id="fair.gif" border="0"/></a><span class="sky">Fair</span> <span class="temp">25&#176;C</span></h4><dl style="display: inline;"> <dt style="display: inline; font-weight: bold;">Humidity:</dt><dd id="humidity" style="display: inline;">50%</dd> <dt style="display: inline; font-weight: bold;">Wind Speed:</dt><dd id="windspeed" style="display: inline;">11 KMH</dd> <dt style="display: inline; font-weight: bold;">Wind Direction:</dt><dd id="winddir" style="display: inline;">W (280&#176;)</dd> <dt style="display: inline; font-weight: bold;">Barometer:</dt><dd id="pressure" style="display: inline;"> 1015 mb</dd> <dt style="display: inline; font-weight: bold;">Dewpoint:</dt><dd id="dewpoint" style="display: inline;">14&#176;C</dd> <dt style="display: inline; font-weight: bold;">Heat Index:</dt><dd id="heatindex" style="display: inline;">26&#176;C</dd> <dt style="display: inline; font-weight: bold;">Wind Chill:</dt><dd id="windchill" style="display: inline;">25&#176;C</dd> <dt style="display: inline; font-weight: bold;">Visibility:</dt><dd id="visibility" style="display: inline;">11 km</dd></dl>]]></content:encoded><guid isPermaLink="false">C-1000 GMT+1 THU JUL 25 2013</guid></item></channel></rss>
ifedotov commented 10 years ago

I get error in same place only my has different message.

  File "./sublime_plugin.py", line 362, in run_
  File "./indentxml.py", line 49, in run
  File "./indentxml.py", line 96, in indent
ImportError: No module named pyexpat
primeminister commented 10 years ago

Same issue here. XML in Sublime text 2 can be indented but not in Sublime 3 with the same plugin. Any fixes yet?

archit-gupta commented 10 years ago

Not working for me in sublime 2. Getting the same error.