-
Bug
-
Resolution: Fixed
-
P3
-
1.2.2
-
beta
-
sparc
-
solaris_2.5.1
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>
======================================================================