marek-stoj/NReadability

Exception on certain URL's - {"The prefix '' cannot be redefined from '' to 'http://www.w3.org/1999/xhtml' within the same start element tag."}

Closed this issue · 2 comments

When I try to Transcode this URL (http://www.rollingstone.com/politics/news/the-ten-worst-members-of-the-worst-congress-ever-20120112), I get the following exception:

Message: {"The prefix '' cannot be redefined from '' to 'http://www.w3.org/1999/xhtml' within the same start element tag."}
Stack Trace:
at System.Xml.XmlWellFormedWriter.PushNamespaceExplicit(String prefix, String ns)
at System.Xml.XmlWellFormedWriter.WriteEndAttribute()
at System.Xml.Linq.ElementWriter.WriteStartElement(XElement e)
at System.Xml.Linq.ElementWriter.WriteElement(XElement e)
at System.Xml.Linq.XElement.WriteTo(XmlWriter writer)
at System.Xml.Linq.XNode.GetXmlString(SaveOptions o)
at System.Xml.Linq.XNode.ToString(SaveOptions options)
at NReadability.DomExtensions.GetInnerHtml(XContainer container) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\DomExtensions.cs:line 232
at NReadability.NReadabilityTranscoder.KillBreaks(XElement element) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityTranscoder.cs:line 1259
at NReadability.NReadabilityTranscoder.PrepareArticleContentElement(XElement articleContentElement) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityTranscoder.cs:line 1096
at NReadability.NReadabilityTranscoder.ExtractArticleContent(XDocument document) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityTranscoder.cs:line 737
at NReadability.NReadabilityTranscoder.TranscodeToXml(String htmlContent, String url, Boolean& mainContentExtracted, String& nextPageUrl) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityTranscoder.cs:line 305
at NReadability.NReadabilityWebTranscoder.Transcode(String url, DomSerializationParams domSerializationParams, Boolean& mainContentExtracted) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityWebTranscoder.cs:line 115
at NReadability.NReadabilityWebTranscoder.Transcode(String url, Boolean& mainContentExtracted) in D:\src\Zaprica\Zaprica.net\ThirdParty\marek-stoj-NReadability-18ccfba\Src\NReadability\NReadability\NReadabilityWebTranscoder.cs:line 142
at Zaprica.Utilities.ReadabilityManager.TranscodeFromUrl(String url) in D:\src\Zaprica\Zaprica.net\Zaprica.Utilities\ReadabilityManager.cs:line 26
at Zaprica.Server.WcfService.transcode.Page_Load(Object sender, EventArgs e) in D:\src\Zaprica\Zaprica.net\Zaprica.Server.Transcoder\transcode.aspx.cs:line 23

Thanks for reporting this.

Fixed.