DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23797>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23797

XMLSerializer doesn't escape ' character to &apos

           Summary: XMLSerializer doesn't escape ' character to &apos
           Product: Xerces2-J
           Version: 2.5.0
          Platform: All
               URL: http://cvs.apache.org/viewcvs.cgi/xml-
                    xerces/java/src/org/apache/xml/serialize/XMLSerializer.j
                    ava?rev=1.54&content-type=text/vnd.viewcvs-markup
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Serialization
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


protected void printXMLChar( int ch, boolean keepQuot) throws IOException {
        
        if ( ch == '<') {
            _printer.printText("&lt;");
        } else if (ch == '&') {
            _printer.printText("&amp;");
        } else if (ch == '>'){
                // character sequence "]]>" can't appear in content, therefore
                // we should escape '>' 
                        _printer.printText("&gt;");             
        } else if ( ch == '"' && ! keepQuot) {
            _printer.printText("&quot;");

-->  these codes may be missed !
-->     } else if ( ch == '\'') {
-->         _printer.printText("&apos;");

        } else if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch)) ||
                    ch == '\n' || ch == '\r' || ch == '\t' ) {
                        // REVISIT: new line characters must be escaped
            _printer.printText((char)ch);
        } else {
            // The character is not printable, print as character reference.
            _printer.printText( "&#x" );
            _printer.printText(Integer.toHexString(ch));
            _printer.printText( ';' );
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to