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=4522>.
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=4522

HTMLSerializer serializes attributes with an empty string value incorrectly

           Summary: HTMLSerializer serializes attributes with an empty
                    string value incorrectly
           Product: Xerces-J
           Version: 1.4.3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Consider the following XHTML fragment:
<IMG alt="" src="some.gif"/> When this fragment is serialized as HTML, the 
output is <IMG alt src="some.gif"> -- according to the HTML spec, this is not 
the correct behavior. The following code snippet in HTMLSerializer is the 
culprit:
// HTML: Empty values print as attribute name, no value.
// HTML: URI attributes will print unescaped
if ( value == null || value.length() == 0 )
    _printer.printText( name );
(in startElement and serialize methods). 
A better solution would be:
if ( value == null || value.length() == 0 )
    _printer.printText( name + "=\"\"");

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

Reply via email to