Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Looking for HTML Renderer

Reply
Thread Tools

Looking for HTML Renderer

 
 
Xiaolei Li
Guest
Posts: n/a
 
      10-06-2004
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.

--
Xiaolei Li | http://www.velocityreviews.com/forums/(E-Mail Removed) | www.xiaolei.org
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-06-2004
On Wed, 6 Oct 2004 22:23:59 +0000 (UTC), Xiaolei Li wrote:

> 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
 
Reply With Quote
 
 
 
 
Xiaolei Li
Guest
Posts: n/a
 
      10-07-2004
Andrew Thompson <(E-Mail Removed)> wrote:
> On Wed, 6 Oct 2004 22:23:59 +0000 (UTC), Xiaolei Li wrote:
>
>> 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?


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.

--
Xiaolei Li | (E-Mail Removed) | www.xiaolei.org
 
Reply With Quote
 
bugbear
Guest
Posts: n/a
 
      10-07-2004
Xiaolei Li wrote:
> Andrew Thompson <(E-Mail Removed)> wrote:
>
>>On Wed, 6 Oct 2004 22:23:59 +0000 (UTC), Xiaolei Li wrote:
>>


>
> 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
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-07-2004
On Thu, 07 Oct 2004 13:04:05 +0100, bugbear wrote:
> Xiaolei Li wrote:

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

...
> IIRC Sun had a native ..


'native' to what?

>..java Browser.


This one?
<http://java.sun.com/products/archive/hotjava/index.html>

> 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
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      10-07-2004
bugbear wrote:
> 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
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      10-07-2004
Andrew Thompson wrote:
> 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
 
Reply With Quote
 
Xiaolei Li
Guest
Posts: n/a
 
      10-07-2004
Thomas Weidenfeller <(E-Mail Removed)> wrote:
> bugbear wrote:
>> IIRC Sun had a native java Browser.

>
> 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.

--
Xiaolei Li | (E-Mail Removed) | www.xiaolei.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
html renderer Robert kebernet Cooper Java 2 06-28-2005 09:06 AM
Serializing HTML document and resources to the HTML renderer unbending Java 0 12-17-2004 04:58 AM
Re: HTML to Text renderer Ian Bicking Python 3 11-09-2004 07:07 PM
HTML to Text renderer Ian Bicking Python 0 11-02-2004 11:07 PM
html renderer Michele Simionato Python 2 11-17-2003 04:27 PM



Advertisments