You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/05/16 06:57:36 UTC

DO NOT REPLY [Bug 9142] New: - HTMLSerializer not showing attributes

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

HTMLSerializer not showing attributes

           Summary: HTMLSerializer not showing attributes
           Product: Xerces2-J
           Version: 2.0.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Serialization
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: step1b@cyberspace.org


The following way of serializing an HTMLDocument
seems to miss out the attributes of all the nodes:

public static String serializeXml(Document doc)
          throws Exception {
  
               try {
                    StringWriter writer = new StringWriter();
                    OutputFormat outputFormat = new OutputFormat
                                                (Method.HTML,"UTF-8",true);
                    outputFormat.setPreserveEmptyAttributes (true);
                    HTMLSerializer serializer = new HTMLSerializer(writer, 
                                                outputFormat);
                    serializer.serialize(doc);
                    String s = writer.toString();
  
                    return s;
               }
               catch (Exception e) {
                    throw new Exception(e.getMessage());
               }
          }
 
 I even tried using the XML and XHTML serializers, same problem.
 
 Pls let me know if I am doing anything wrong, or is this a bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org