aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes HtmlEditorKit/HtmlDocument/HtmlReader problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "HtmlEditorKit/HtmlDocument/HtmlReader problem" Watch "HtmlEditorKit/HtmlDocument/HtmlReader problem" New topic
Author

HtmlEditorKit/HtmlDocument/HtmlReader problem

Aknod Algabar
Greenhorn

Joined: Feb 01, 2010
Posts: 2
Hello,

Using JTextPane editing HTML in my application I found that HtmlReader (probably) ignores/removes empty paragraphs... For example, loading the following HTML code

<html>
<head>

</head>
<body>
<p style="margin-top: 0">

</p>
</body>
</html>

causes something like that

<html>
<head>

</head>
<body>
</body>
</html>

Also it ignores/removes table cells with empty paragraph elements inside. It is interesting that it removes only one element per getText/setText iteration.

This unwanted removing of empty elements causes a lot of headache during editing, etc.

I appreciate any comments and suggestions how to fix it.

Thank you,

Alex
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HtmlEditorKit/HtmlDocument/HtmlReader problem