Closed Bug 680248 Opened 13 years ago Closed 13 years ago

Add-on validator doesn't parse CDATA in XML properly.

Categories

(addons.mozilla.org Graveyard :: Add-on Validation, defect, P5)

Tracking

(Not tracked)

RESOLVED FIXED
Q4 2011

People

(Reporter: mkaply, Assigned: basta)

References

Details

I'm getting multiple errors like this in my addon:

Warning: Markup tags cannot be closed before they are opened. Perhaps you were just a little overzealous with forward-slashes?

Warning: Tag "handler" closed before it was opened

It appears the validator has trouble when CDATA is not on it's own line.

For example:

      <handler event="focus"><![CDATA[
        document.getAnonymousElementByAttribute(this, "anonid", "textbox").select();
       ]]>
      </handler>

Or

Warning: Tag "constructor" closed before it was opened
chrome/content/bindings/dtsearchbox.xml
<constructor><![CDATA[
]]></constructor>
<method name="handleSearchCommand">
Thanks, this sounds like it might be hard to fix
Severity: normal → minor
Priority: -- → P5
Target Milestone: --- → Future
What changed to make this start reporting?

It wasn't before.

This seems like an odd thing for the validator to check for since the add-on probably wouldn't work at al if this was in the XUL.

Were there add-ons being submitted with this problem?
We are seeing this in an XBL file, and it is the source of about 30 warnings for our extension.  The extension and the XBL both work fine.
Could you do a few things? First, could you upload the add-on that you're seeing the issue on? And also, what version of Python are you using?

We take advantage of the HTMLParser class in the standard library. It has been known, however, to have a cluster of bugs regarding its handling of CDATA processing instructions and RCDATA elements. Certain versions of Python might have bugs that other versions don't.
Sure:

* It's the current version of the stumbleupon addon in the gallery (3.95): https://addons.mozilla.org/firefox/downloads/latest/138/addon-138-latest.xpi?src=addondetail

* I am not running the standalone validator, but instead uploading to AMO and letting it tell me the warnings.

FYI:  I just worked around them all by doing as Michael suggested and putting a CR before the beginning of the CDATA tag and a CR after the end of it.
Blocks: 688514
Target Milestone: Future → 6.2.6
I am still seeing this warning for https://addons.mozilla.org/firefox/downloads/latest/138/addon-138-latest.xpi?src=addondetail

See the validation results at https://addons-dev.allizom.org/en-US/developers/upload/2e92b8bd7c614f8f840fb9e55b833eec

I looked at the file and looks okay to me. Am I missing something?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I only see 1 warning now, and it's not mentioned above:

------------------------------------------------------------
Parse error: tag closed before opened

Warning: Markup tags cannot be closed before they are opened. Perhaps you were just a little overzealous with forward-slashes?

Warning: Tag "a" closed before it was opened
content/stumbleuponOverlay.js
1
0<u style="color:rgb(21,73,193);">See&nbsp;StumbleUpon&nbsp;friend&
------------------------------------------------------------

Is this the same bug?
Assignee: nobody → mattbasta
Target Milestone: 6.2.6 → Q4 2011
I can't reproduce this locally with the XPI from comment 8, and I'm not seeing the parse error from comment 9. Please reopen if this issue still exists.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.