<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 89: Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/" rel="alternate"/><link href="https://sourceforge.net/p/cssparser/bugs/89/feed.atom" rel="self"/><id>https://sourceforge.net/p/cssparser/bugs/89/</id><updated>2021-09-10T19:08:55.021000Z</updated><subtitle>Recent changes to 89: Incorrect attributes - improved error message would be helpful</subtitle><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#5457" rel="alternate"/><published>2021-09-10T19:08:55.021000Z</published><updated>2021-09-10T19:08:55.021000Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net556990afabc03c6c19a42b804d551e2d6ab98849</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Any updates or insights about what version to use? Especially since the version numbers have a big difference. Is this verison here on Sourceforge still an actively developed one or does the focus shift to the github version? &lt;br/&gt;
It would be great to get at least an idea. Thx&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#3a6e" rel="alternate"/><published>2021-08-18T09:09:10.684000Z</published><updated>2021-08-18T09:09:10.684000Z</updated><author><name>LeO</name><uri>https://sourceforge.net/u/leo_forge/</uri></author><id>https://sourceforge.net66bb709abfcad3239d74e2dbe8368e3554b84eb8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi RBRi,&lt;/p&gt;
&lt;p&gt;the link with the HTML-Unit works - if I remove the dot in the link :-) Anyway - this raises the first question: Which one to use? Either here from Sourceforge or the one from Github?&lt;/p&gt;
&lt;p&gt;About the message: Yeah the hint to the customized error eases the pain; but the URI remains null. If the URI would provide at least the attribute-name than it would be quite usable.&lt;br/&gt;
thx&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#1924" rel="alternate"/><published>2021-08-17T13:41:27.494000Z</published><updated>2021-08-17T13:41:27.494000Z</updated><author><name>RBRi</name><uri>https://sourceforge.net/u/rbri/</uri></author><id>https://sourceforge.net8b4396ec4b23d1dcb51c69410b916febc82fc87d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;There is some documentation about customizing the error handling- see &lt;a href="http://cssparser.sourceforge.net/gettingStarted.html" rel="nofollow"&gt;http://cssparser.sourceforge.net/gettingStarted.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you please check if this does the job for you - CSSParseException has getColumnNumber()&lt;br/&gt;
getLineNumber() and getURI() as additional properties to CSSException.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#39f2" rel="alternate"/><published>2021-08-17T13:30:11.535000Z</published><updated>2021-08-17T13:30:11.535000Z</updated><author><name>RBRi</name><uri>https://sourceforge.net/u/rbri/</uri></author><id>https://sourceforge.net59c14d4343c65d9ad5733299f5edb2bf6fc4a5bc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi LeO,&lt;/p&gt;
&lt;p&gt;thanks for you interest in CSSParser and the bug report.&lt;br/&gt;
The error messages are more or less generic because CSSParser uses JavaCC for the parser construction. Will have a look if i can make at least the numbers more obvious.&lt;/p&gt;
&lt;p&gt;BTW: there is a bit mor 'modern' version of the CSSParser used by HtmlUnit available at &lt;a href="https://github.com/HtmlUnit/htmlunit-cssparser." rel="nofollow"&gt;https://github.com/HtmlUnit/htmlunit-cssparser.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If i can find a way to improve the error msg i will implement it for both.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#885e" rel="alternate"/><published>2021-08-17T07:03:17.653000Z</published><updated>2021-08-17T07:03:17.653000Z</updated><author><name>LeO</name><uri>https://sourceforge.net/u/leo_forge/</uri></author><id>https://sourceforge.net7e0a43d7546f82631064f4dd6fb325f23d6408a6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Just a tiny remark to my last one: &lt;/p&gt;
&lt;p&gt;We want to use the CSSparser in our project since it looks very, very promising. Since we have different libs included an exception is always hard to track if one doesn't know the source. &lt;/p&gt;
&lt;p&gt;In my scenario I didn't know if the Error was raised by Jsoup or CSSparser. So my suggestion would be:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;CSSParser&lt;/span&gt; &lt;span class="nt"&gt;Error&lt;/span&gt; &lt;span class="nt"&gt;at&lt;/span&gt; &lt;span class="nt"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;character&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;16&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nt"&gt;attribute&lt;/span&gt; &lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'font-family'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#68ca" rel="alternate"/><published>2021-08-16T18:40:04.360000Z</published><updated>2021-08-16T18:40:04.360000Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net5f9867384c2ba2d9f74e0d2993a2f5cc88e879aa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;well - agreed 😊 if I understand the magic numbers 2:16. but why not make it more explicit, i.e&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;Error&lt;/span&gt; &lt;span class="nt"&gt;at&lt;/span&gt; &lt;span class="nt"&gt;osition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;character&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;16&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nt"&gt;attribute&lt;/span&gt; &lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;font-family&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;i have a SQL editor mentioning only the position - when all lines are concatenated. I never know where the error is since i have no clue how the string internally looks like and if there is some additional formatting done. therefore I don't really trust chars positions.&lt;/p&gt;
&lt;p&gt;anyway - if you think the magic of 2:16 is broadly understood outside the developers of CSS parser thank I'm happy. At least I understand it now better.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#89 Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/?limit=25#2d3a" rel="alternate"/><published>2021-08-16T16:23:31.873000Z</published><updated>2021-08-16T16:23:31.873000Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net66f5b02b7aa5aba571c25c85d10e34947d3a7e48</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The 2:16 mean that the Error is in Line 2 Character 16 so i believe the Error Message ist quite detailed&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Incorrect attributes - improved error message would be helpful</title><link href="https://sourceforge.net/p/cssparser/bugs/89/" rel="alternate"/><published>2021-08-16T09:45:26.006000Z</published><updated>2021-08-16T09:45:26.006000Z</updated><author><name>LeO</name><uri>https://sourceforge.net/u/leo_forge/</uri></author><id>https://sourceforge.net943f0c09a172c803a690044764554adf9176b0e3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have an invalid CSS like &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liberatio&lt;/span&gt;
&lt;span class="s1"&gt; Sans'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Roboto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Arimo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As a result I received&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;null [2:16] Fehler in Ausdruck. (Ungültiger Token "\'". Erwartet wurde einer von: &amp;lt;S&amp;gt;, &amp;lt;NUMBER&amp;gt;, "inherit", &amp;lt;IDENT&amp;gt;, &amp;lt;STRING&amp;gt;, "-", &amp;lt;PLUS&amp;gt;, &amp;lt;HASH&amp;gt;, &amp;lt;EMS&amp;gt;, &amp;lt;REM&amp;gt;, &amp;lt;EXS&amp;gt;, &amp;lt;CH&amp;gt;, &amp;lt;VW&amp;gt;, &amp;lt;VH&amp;gt;, &amp;lt;VMIN&amp;gt;, &amp;lt;VMAX&amp;gt;, &amp;lt;LENGTH_PX&amp;gt;, &amp;lt;LENGTH_CM&amp;gt;, &amp;lt;LENGTH_MM&amp;gt;, &amp;lt;LENGTH_
IN&amp;gt;, &amp;lt;LENGTH_PT&amp;gt;, &amp;lt;LENGTH_PC&amp;gt;, &amp;lt;ANGLE_DEG&amp;gt;, &amp;lt;ANGLE_RAD&amp;gt;, &amp;lt;ANGLE_GRAD&amp;gt;, &amp;lt;TIME_MS&amp;gt;, &amp;lt;TIME_S&amp;gt;, &amp;lt;FREQ_HZ&amp;gt;, &amp;lt;FREQ_KHZ&amp;gt;, &amp;lt;RESOLUTION_DPI&amp;gt;, &amp;lt;RESOLUTION_DPCM&amp;gt;, &amp;lt;PERCENTAGE&amp;gt;, &amp;lt;DIMENSION&amp;gt;, &amp;lt;UNICODE_RANGE&amp;gt;, &amp;lt;URI&amp;gt;, &amp;lt;FUNCTION_CALC&amp;gt;, &amp;lt;FUNCTION_VAR&amp;gt;, &amp;lt;FUNCTION&amp;gt;, "p
rogid:".)
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It took me quite a while to realize that the CR in the font-family was not valid. I didn't know where the error was originated. I would highly appreciate if the error message would include the element and the attribute, i.e. something like &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;body =&amp;gt; font-family caused
....
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry></feed>