library for rendering HTML

L

Lars

Hi,

is there a free Java library for displaying HTML? I would prefer one
that supports more recent versions HTML than classes like JEditorPane or
HTMLEditorKit do.

Thanks in advance,

Lars
 
Z

zero

Lars said:
Hi,

is there a free Java library for displaying HTML? I would prefer one
that supports more recent versions HTML than classes like JEditorPane or
HTMLEditorKit do.

Thanks in advance,

Lars

About a year ago I spent several months looking for exactly this, but came
up with nothing. All free java html renderers I found were terribly
outdated. There are several proprietary modules (eg ICEsoft) out there,
but I found even those to be rather disappointing in terms of features and
correct rendering.

Depending on what you need, a possible solution is to embed an existing
browser (Mozilla, IE, ...) into your java application.

You could also have a look at:
http://www.kaffe.org/ftp/pub/packages/pocketlinux/
http://java-source.net/open-source/html-parsers
 
Z

zero

About a year ago I spent several months looking for exactly this, but
came up with nothing. All free java html renderers I found were
terribly outdated. There are several proprietary modules (eg ICEsoft)
out there, but I found even those to be rather disappointing in terms
of features and correct rendering.

Depending on what you need, a possible solution is to embed an
existing browser (Mozilla, IE, ...) into your java application.

You could also have a look at:
http://www.kaffe.org/ftp/pub/packages/pocketlinux/
http://java-source.net/open-source/html-parsers

PS: In the end I used the Calpa html browser, available from
http://htmlbrowser.sourceforge.net/
 
L

Lars

PS: In the end I used the Calpa html browser, available from
http://htmlbrowser.sourceforge.net/

To me, Calpa is too much of a "closed box". One cannot even access the
document that is displayed. Nevertheless, thank you, and let's hope that
standard Java will provide some decent HTML 4.0 support in the future.

http://java.sun.com/j2se/1.3/docs/api/javax/swing/text/html/HTMLEditorKit.html
http://download.java.net/jdk6/docs/api/javax/swing/text/html/HTMLEditorKit.html

It still reads: "The default support is provided by this class, which
supports HTML version 3.2 (with some extensions), and is migrating
toward version 4.0."

Isn't it time to finish migrating by now?

Lars
 
A

Andrew Thompson

Lars said:
...let's hope that
standard Java will provide some decent HTML 4.0 support in the future.

Hope, sure, but don't hold your breath. It is more likely Java
will allow you to connect to the 'default browser' than that it
will ever provide good rendering of the sort of HTML (mostly invalid
and badly formed) you generally find on the wilds of the internet.

If it were a matter of rendering valid and well formed HTML, it
would be much simpler, but that is of little use.
 
R

Roedy Green

If it were a matter of rendering valid and well formed HTML, it
would be much simpler, but that is of little use.

Notice how Netscape gives you the option of using its own or IE's
rendering engine. This implies IE is providing an interface to its
engine. Perhaps that interface will evolve and become something
pluggable available on any platform.
 
A

Andrew Thompson

Roedy said:
Notice how Netscape gives you the option of using its own or IE's
rendering engine. This implies IE is providing an interface to its
engine. Perhaps that interface will evolve and become something
pluggable available on any platform.

Given the number of malformed web-pages that exist
mostly because 'it looks fine in IE', that is a
worrying thought.

And as an aside, after a recent spyware infection that
was largely due to browser security holes, I have decided
to discontinue using IE as my default browser. I cannot
afford to install IE SP 2, since that knobbles IE (for
testing), and it is too dangerous to run on the wilds of
the internet in its un-'service pack 2'ed form.
 
Z

zero

Given the number of malformed web-pages that exist
mostly because 'it looks fine in IE', that is a
worrying thought.

And as an aside, after a recent spyware infection that
was largely due to browser security holes, I have decided
to discontinue using IE as my default browser. I cannot
afford to install IE SP 2, since that knobbles IE (for
testing), and it is too dangerous to run on the wilds of
the internet in its un-'service pack 2'ed form.

I have been using Opera as default browser since version 4 or so.
Basically anything is better than IE. But you should still keep a copy of
IE on your machine since many websites don't work on the stricter browsers.

Btw HTML is now a "dead" format, which is supposed to be replaced by XHTML
(version 2.0 is in its 7th working draft). One of the main requirements of
XHTML is that it's well-formed (cfr XML well-formedness) Let's hope it
catches on quickly.
 
R

Roedy Green

Btw HTML is now a "dead" format, which is supposed to be replaced by XHTML
(version 2.0 is in its 7th working draft). One of the main requirements of
XHTML is that it's well-formed (cfr XML well-formedness) Let's hope it
catches on quickly.

I felt that sentiment until I started the job of converting my website
to XHTML.

Then I decided we had a bunch of prissy queens involved in a pointless
make work project. Having a rigid grammar is one thing. Adding
verbosity is not.

For what I really think of it see
http://mindprod.com/jgloss/xhtml.html

This is too bad. We really need something LIKE XHTML. I would prefer
a pre-parsed compact rigidly-specified binary format that can be
rendered faster and before the whole document arrives.
 
A

Andrew Thompson

zero said:
I have been using Opera as default browser since version 4 or so.
Basically anything is better than IE.

I disagree. Neither Opera nor the Mozilla based browsers are as
good at correcting malformed HTML as IE. I think this is a clever
strategy by MS, since a lot of the first malformed pages were written
by programs like MS Word - exporting files 'As Web Page' and improperly
nesting tags along the way.

Quite an advantage for IE to be able to render these malformed
pages flawlessly. At one stage, almost 50% of the code of IE
was aimed at correcting crappy HTML.
.. But you should still keep a copy of
IE on your machine

Have you managed to remove IE from any Windows machine?!?
..since many websites don't work on the stricter browsers.

Estimates are that the vast majority of HTML is malformed.
Btw HTML is now a "dead" format,

No it is not. HTML 4.01 documents will be produced for
many years to come.
..which is supposed to be replaced by XHTML
(version 2.0 is in its 7th working draft). One of the main requirements of
XHTML is that it's well-formed (cfr XML well-formedness) Let's hope it
catches on quickly.

From crappy HTML generated by MS tools, to bloated browsers,
intended to display that crappy HTML (also from MS), ..now to
a document format which is patented by MS.

Congratulations Bill, your plan to dominate the net is going
well, despite your company's late start!
 
A

Andrew Thompson

Roedy said:
could you translate that into American or Canadian?

SP2 - Service Pack 2. Internet Explorer behaves very
differently once SP2 is installed. Pop-Ups, frames,
DHTML (both JavaScript and Java) all act at least
slightly differently.

It would be nice to have both on hand (IE with and without
SP2)to compare the differences, but as I understand, the
only way to 'uninstall' SP2 is to wipe the system.

So, I develop for "General browsers and pre SP2 IE"
(at the moment). IE users who have installed SP2 can
take their problems to MS, as far as I am concerned.
 
C

Chris Smith

Andrew Thompson said:
SP2 - Service Pack 2.

I think we all know what SP 2 means. I wondered (and I assume Roedy
did, as well) what "knobbles" means. :)

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Andrew Thompson

Chris said:
I think we all know what SP 2 means. I wondered (and I assume Roedy
did, as well) what "knobbles" means. :)

Oh! By 'knobbles', I mean 'limits' or 'blocks'
things that could formerly be done easily.

But surely, as a term from ..horse racing(?) I thought
that would be a fairly well understood word across the
western world*?

* Though of course, few people's are as serious about
their gambling as Aussies typically are.
 
R

Roedy Green

SP2 - Service Pack 2. Internet Explorer behaves very
differently once SP2 is installed. Pop-Ups, frames,
DHTML (both JavaScript and Java) all act at least
slightly differently.

I take it you can tell if SP2 has been applied by looking at the about
box in IE.

I do this on my machine and see SP1 but no SP2. Yet windows update
and baseline says I am up to date. I take it this is because I am
Win2K and this applies only to XP?
 
A

Andrew Thompson

Roedy said:
I take it you can tell if SP2 has been applied by looking at the about
box in IE.

Not sure.
I do this on my machine and see SP1 but no SP2. Yet windows update
and baseline says I am up to date. I take it this is because I am
Win2K and this applies only to XP?

No. As I understand, any IE 5 or IE 6 (I neither know nor
care about IE 4) that does not have SP2 installed* is
vulnerable to the attacks that SP2 was designed to stop.

* Their are a number of installable tool-bars for IE
(e.g. the Google toolbar), any of which might do parts
of what SP2 does.
 
C

Chris Uppal

Andrew said:
Oh! By 'knobbles', I mean 'limits' or 'blocks'
things that could formerly be done easily.

But surely, as a term from ..horse racing(?) I thought
that would be a fairly well understood word across the
western world*?

It's usually spelled without the 'k'.

And yes, it does seem to be from the horse-racing world; at least the OED
states that it is "of obscure origin" but its earliest reference for the word,
from 1847, has that context.

-- chris
 
A

Andrew Thompson

Chris said:
It's usually spelled without the 'k'.

D'Oh! That explains why none of the web definitions
of 'knobbled' did *not* refer to horses or racing so
much as either ..
a) A small knob
b) A texture (consisting of lots of small knobs)
And yes, it does seem to be from the horse-racing world; at least the OED
states that it is "of obscure origin" but its earliest reference for the word,
from 1847, has that context.

It was after examining my father's 'concise' English dictionary
that spanned two volumes, contained approximately 350,000 words,
and was solid enough to form a weapon suitable for pig hunting,
that I decided that English has far too many words. ;-)
 
R

Raymond DeCampo

Roedy said:
Notice how Netscape gives you the option of using its own or IE's
rendering engine. This implies IE is providing an interface to its
engine. Perhaps that interface will evolve and become something
pluggable available on any platform.

On Windows, IE is available as some flavor of COM object. This has been
the case for some time. You may have noticed that some Windows programs
use an HTML interface (e.g. some printer drivers, installers, etc.).
These are likely using IE under the hood. This lets you apply the MVC
approach of servlets and JSPs to native Windows applications, if you so
desire.

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top