ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49404] XMLJUnitResultFormatter does not encode entity/character references
Date Tue, 08 Jun 2010 15:04:36 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49404

Stefan Bodewig <bodewig@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW
            Version|unspecified                 |1.8.1

--- Comment #2 from Stefan Bodewig <bodewig@apache.org> 2010-06-08 11:04:32 EDT ---
found the reason, not sure how to fix it.

XMLJUnitResultFormatter uses DOMElementWriter which encodes both attributes and
element content.  The following part of the encode method

            case '&':
                int nextSemi = value.indexOf(";", i);
                if (nextSemi < 0
                    || !isReference(value.substring(i, nextSemi + 1))) {
                    sb.append("&amp;");
                } else {
                    sb.append('&');
                }
                break;

contains some special handling that explicitly suppresses encoding of an
ampersand if it starts an entity reference.

I don't recall why the code does what it does but changing it is likely going
to cause other trouble.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message