Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1347367 - New HTML report is not valid XML
Summary: New HTML report is not valid XML
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openscap
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Jan Černý
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-16 15:44 UTC by Alois Mahdal
Modified: 2016-06-22 16:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-22 16:13:46 UTC
Target Upstream Version:


Attachments (Terms of Use)
TESTOUT.log (2.53 MB, text/plain)
2016-06-16 15:46 UTC, Alois Mahdal
no flags Details

Description Alois Mahdal 2016-06-16 15:44:54 UTC
Description of problem
======================

HTML report is not a valid XML. xmllint swarms:

    $ xmllint /root/preupgrade/result.html
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.e
                                           ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.e
                                            ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    -1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : EntityRef: expecting ';'
    )},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    ,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    &(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    (j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    &&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    &(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : xmlParseEntityRef: no name
    =this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&
                                                                                   ^
    /root/preupgrade/result.html:10: parser error : EntityRef: expecting ';'
    his,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c

    [...]

The XML report is OK.
                                                                                   ^

Version-Release number of selected component
============================================

openscap-1.2.8-2.el6


Additional info
===============

This particular case is from preupgrade-assistant, TJ#1368887. I have
checked with Marek Haičman that this is happening also in his environment,
without p-a.

From usability point of view (at least in preupgrade-assistant context),
it's not necessary for the file to be proper XML, but the previous format
did have that property, so we kept the test enabled "just in case".

Furthermore, this could actually be side effect of different issue.

Comment 1 Alois Mahdal 2016-06-16 15:46:09 UTC
Created attachment 1168781 [details]
TESTOUT.log

Comment 3 Martin Preisler 2016-06-20 19:38:28 UTC
The new HTML report uses HTML5. HTML5 is not valid XML, it is not even well-formed XML. Therefore the xmllint test should be disabled.

That said, I think we should add CDATA wrapper in <style> and <script> elements to make these warnings disappear. Tracking upstream in https://github.com/OpenSCAP/openscap/issues/441

Comment 4 Jan Černý 2016-06-22 09:47:52 UTC
Using <![CDATA[]]> in <style> and <script> elements will not remove all the errors. I have verified it. Actually xmllint will still report a large amount of errors. That is because HTML document contains tags like <br> which hasn't corresponding end tags (there is no </br>). Such elements will cause xmllint errors like "Opening and ending tag mismatch". As Martin Preisler mentioned, HTML documents aren't supposed to be a valid XML document. Therefore you can't use xmllint to validate a HTML document.
A web technology that is compatible with XML is called XHTML, which has different rules than HTML used in our report.

I suggest closing this bug, because the HTML report shouldn't be a valid XML.

Comment 5 Martin Preisler 2016-06-22 16:13:46 UTC
I looked into this and I agree with Jan Cerny, CDATA is not relevant in HTML5. Therefore I am closing this as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.