RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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:
Embargoed:


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.