Looking for HTML Renderer

Discussion in 'Java' started by Xiaolei Li, Oct 6, 2004.

  1. Xiaolei Li

    Xiaolei Li Guest

    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 | | www.xiaolei.org
     
    Xiaolei Li, Oct 6, 2004
    #1
    1. Advertising

  2. 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
     
    Andrew Thompson, Oct 6, 2004
    #2
    1. Advertising

  3. Xiaolei Li

    Xiaolei Li Guest

    Andrew Thompson <> 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 | | www.xiaolei.org
     
    Xiaolei Li, Oct 7, 2004
    #3
  4. Xiaolei Li

    bugbear Guest

    Xiaolei Li wrote:
    > Andrew Thompson <> 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
     
    bugbear, Oct 7, 2004
    #4
  5. 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
     
    Andrew Thompson, Oct 7, 2004
    #5
  6. 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
     
    Thomas Weidenfeller, Oct 7, 2004
    #6
  7. 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
     
    Thomas Weidenfeller, Oct 7, 2004
    #7
  8. Xiaolei Li

    Xiaolei Li Guest

    Thomas Weidenfeller <> 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 | | www.xiaolei.org
     
    Xiaolei Li, Oct 7, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. unbending
    Replies:
    0
    Views:
    358
    unbending
    Dec 17, 2004
  2. Robert kebernet Cooper

    html renderer

    Robert kebernet Cooper, Jun 27, 2005, in forum: Java
    Replies:
    2
    Views:
    2,308
    Roedy Green
    Jun 28, 2005
  3. Michele Simionato

    html renderer

    Michele Simionato, Nov 16, 2003, in forum: Python
    Replies:
    2
    Views:
    438
    John J. Lee
    Nov 17, 2003
  4. Ian Bicking

    HTML to Text renderer

    Ian Bicking, Nov 2, 2004, in forum: Python
    Replies:
    0
    Views:
    299
    Ian Bicking
    Nov 2, 2004
  5. Ian Bicking

    Re: HTML to Text renderer

    Ian Bicking, Nov 3, 2004, in forum: Python
    Replies:
    3
    Views:
    514
    Ivo Woltring
    Nov 9, 2004
Loading...

Share This Page