Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P3
-
Resolution: Fixed
-
Affects Version/s: 1.2.2
-
Fix Version/s: 1.3.0
-
Component/s: client-libs
-
Labels:
-
Subcomponent:
-
Resolved In Build:beta
-
CPU:sparc
-
OS:solaris_2.5.1
Description
Name: aaC67449 Date: 02/25/99
HTMLEditorKit.read(...) creates incorrect Document for html with empty BODY.
It generates two BODY sections.
See example
------------------Example-----------------------------------
import javax.swing.text.html.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
import java.io.*;
public class Test {
public static void main(String argv[]) {
String test1="<!DOCTYPE HTML PUBLIC \"-//w3c//DTD html 3.2//EN\"><HTML><HEAD><TITLE>test</TITLE></HEAD><BODY></BODY></HTML>";
HTMLEditorKit c= new HTMLEditorKit();
Document doc = c.createDefaultDocument();
try {
c.read(new StringReader(test1),doc,0); // prepare test document
StringWriter sw=new StringWriter();
c.write(sw,doc,0,10);
System.out.println(sw.toString());
} catch(Exception e) {
e.printStackTrace();
}
}
}
-------------------Output------------------------------------
<html>
<head>
<title>test </title>
</head>
<body>
</body>
<body>
<p>
</p>
</body>
</html>
======================================================================