Looking for HTML Renderer

X

Xiaolei Li

hi,

i'm looking for a HTML rendered for java. some functionalities i want
are (1) be able to access the DOM tree for the HTML file and (2) given
some DOM object, find out its physical location (and maybe other
properties like color, size, etc) on the rendered page.

i know this is possible through IE but unfortunately, i can't use IE.
JRex (http://jrex.mozdev.org/) *seems* like it has what i want but i've
read that it doesn't satisfy (2). does anyone know how to achieve this?
thank you.
 
A

Andrew Thompson

i'm looking for a HTML rendered for java. some functionalities i want
are (1) be able to access the DOM tree for the HTML file and (2) given
some DOM object, find out its physical location ...

Why do you want to know the physical location?

It is just that each browser will probably render a page
slightly differently, so what is the point or end purpose
of knowing the physical location of an UI element in a
web-page as rendered by that particular browser?

What do you want to achieve as the end result?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
X

Xiaolei Li

Andrew Thompson said:
Why do you want to know the physical location?

It is just that each browser will probably render a page
slightly differently, so what is the point or end purpose
of knowing the physical location of an UI element in a
web-page as rendered by that particular browser?

What do you want to achieve as the end result?

the algorithm constructs blocks out of the page based on visual cues.
see the algorithm here: http://www.cen.uiuc.edu/~dengcai2/VIPS/VIPS.html
basically, it's vision-based partitioning of the webpage. more
intuitive than a simple DOM tree.

anyway, i think the slight differences between browsers won't matter too
much. any competent renderer will do.
 
B

bugbear

anyway, i think the slight differences between browsers won't matter too
much. any competent renderer will do.

<speculation>

IIRC Sun had a native java Browser.
If this is open source, you may be able
to exploit the renderer.

</speculation>

BugBear
 
A

Andrew Thompson

Xiaolei Li wrote: ... ...
IIRC Sun had a native ..

'native' to what?
..java Browser.

This one?
If this is open source, you may be able
to exploit the renderer.

As I understand it is based upon JEditorPane(/JEditorPain).
Can anyone confirm?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
T

Thomas Weidenfeller

bugbear said:
IIRC Sun had a native java Browser.

Yes, it was called HotJava.
If this is open source, you may be able
to exploit the renderer.

Parts of it became the HTML parser in Swing. This parser-related
comp.lang.java.gui FAQ (v1.13) questions:

6.3 Styled Text / JEditorPane / JTextPane
Q6.3.1 Can I use RTFEditorKit to read RTF documents created by Word?
Q6.3.2 I have problems using the Swing HTML parser to parse all
kinds of HTML. Is this normal?
Q6.3.3 Some of my CSS styles don't work out. Is this normal?
Q6.3.4 Can I use Swing's HTML support to write a web browser?
Q6.3.5 Can I use Swing's HTML support to build an on-line
help system or e-book?
Q6.3.6 If HTML support is really so broken in Java, what is it
good for?

/Thomas
 
T

Thomas Weidenfeller

Andrew said:
As I understand it is based upon JEditorPane(/JEditorPain).
Can anyone confirm?

It's the other way around. The HotJava remains were recycled in Swing.
This is the reason why you suddenly see "documents" for this components,
instead of "models".

/Thomas
 
X

Xiaolei Li

Thomas Weidenfeller said:
Yes, it was called HotJava.

Parts of it became the HTML parser in Swing. This parser-related
comp.lang.java.gui FAQ (v1.13) questions:

Q6.3.2 I have problems using the Swing HTML parser to parse all kinds
of HTML. Is this normal?
Q6.3.3 Some of my CSS styles don't work out. Is this normal?
Q6.3.6 If HTML support is really so broken in Java, what is it good
for?

From the answers in the FAQ, the Swing HTML parser seems old and broken
(for real world purposes). So back to my original question, is there
anything out there that'll do what I want (render and relate to a DOM
tree)? I've looked at NekoHTML/JTidy/Xerces. It was easy to have them
build a DOM document for a HTML page. But they don't have any rendering
component. JRex *seems* like it has what I want but I haven't had time
to mess with it.
Thanks.
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top