Bug 744200
| Summary: | Lines starting with whitespaces in XML files lead to perl warnings | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Marko Karg <mkarg> | ||||||||
| Component: | perl-XML-SAX | Assignee: | Petr Pisar <ppisar> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Petr Šplíchal <psplicha> | ||||||||
| Severity: | unspecified | Docs Contact: | |||||||||
| Priority: | medium | ||||||||||
| Version: | 5.7 | CC: | ohudlick, ppisar, psabata, psplicha | ||||||||
| Target Milestone: | rc | Keywords: | EasyFix, Patch | ||||||||
| Target Release: | 5.8 | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | perl-XML-SAX-0.14-11 | Doc Type: | Bug Fix | ||||||||
| Doc Text: |
Cause
Parsing a XML document starting with a white space.
Consequence
Warning `Unable to recognize encoding of this document'
has been printed.
Fix
Encoding detection code has been changed to recognize
XML document with leading white space as document
without XML declaration and with default encoding.
Result
No warning is printed anymore as such documents are
valid documents with encoding detection rules conforming
to documents without XML declaration.
|
Story Points: | --- | ||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2011-11-14 03:07:04 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Marko Karg
2011-10-07 13:05:47 UTC
Created attachment 526893 [details]
perl script
Created attachment 526894 [details]
input file for the script
Created attachment 526895 [details]
upstream patch
Upstream fixed this issue in version 2.15 (available from <http://cpan.metacpan.org/authors/id/G/GR/GRANTM/>) by accepting XML document starting with white spaces and defaulting to implicit encoding. This effectively silent the warning. This is the 4-line patch attached by Marcela. Simple test case: $ perl -MXML::Simple -e 'XML::Simple::XMLin(q{ <f/>})'
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Cause
Parsing a XML document starting with a white space.
Consequence
Warning `Unable to recognize encoding of this document'
has been printed.
Fix
Encoding detection code has been changed to recognize
XML document with leading white space as document
without XML declaration and with default encoding.
Result
No warning is printed anymore as such documents are
valid documents with encoding detection rules conforming
to documents without XML declaration.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1446.html |