HTML-Parser-Libary?

Hello,
At the moment I’m coding a visualisation-program for a solar-system on top of the roof of our school.
The program should also be able to print out HTML-Sites, but I’m too lazy to code a parser by myself. So does anybody know a HTML-Parser-Libary for SDL or has another straightforward solution?
Is it for example possible and practical to let Firefox draw the Page in the Background and shoot an image of the site parsed by Firefox and display it via SDL?
The program is going to run under Linux.

Sorry for my bad English, hope you understood everything :slight_smile:

Thanks and greetings from Germany
Marc Gerritzen

Marc Gerritzen <Marc.Gerritzen t-online.de> writes:

Hello,
At the moment I’m coding a visualisation-program for a solar-system on
top of the roof of our school.
The program should also be able to print out HTML-Sites, but I’m too lazy
to code a parser by myself. So does
anybody know a HTML-Parser-Libary for SDL or has another straightforward
solution?
Is it for example possible and practical to let Firefox draw the Page
in the Background and shoot an image of
the site parsed by Firefox and display it via SDL?
The program is going to run under Linux.

From what you describe, it sounds like you mean more than an HTML parser
(which would just examine the HTML code), you want an HTML rendering
engine. I don’t know of any that you could use personally, but I thought
I should clear that up for anybody who has some useful links or anything.
I don’t know if KHTML (used by Konqueror) would do the job.

Here’s a perl script I just found off google, seems to be a pretty hacky
way of capturing a page from Mozilla, but you might want to try it.
http://marginalhacks.com/Hacks/html2jpg/

and having said that, here’s a program that uses KHTML
http://www.babysimon.co.uk/khtml2png/index.html

Hope that helps (although none of it is to do with SDL!).

Nick H

Nick wrote:

From what you describe, it sounds like you mean more than an HTML parser
(which would just examine the HTML code), you want an HTML rendering
engine. I don’t know of any that you could use personally, but I thought
I should clear that up for anybody who has some useful links or anything.
I don’t know if KHTML (used by Konqueror) would do the job.

Here’s a perl script I just found off google, seems to be a pretty hacky
way of capturing a page from Mozilla, but you might want to try it.
http://marginalhacks.com/Hacks/html2jpg/

and having said that, here’s a program that uses KHTML
http://www.babysimon.co.uk/khtml2png/index.html

Kde has something else that does the same (maybe realted to khtml2png)
called kwebdestkop.
It’s usually installed as a part of kde.

Also see this post with mozilla :
http://twomix.devolution.com/pipermail/sdl/2003-November/058054.html

Stephane

anybody know a HTML-Parser-Libary for SDL or has another straightforward
solution?

You might want to take a look at the code that I wrote for SuperWaba. There is
a tokenizer/parser and a renderer. It handles most of the HTML tags, and is
very efficient in parsing (runs on embedded devices.) This is java, but enough
isolated to migrate it to C (if you need it.)

To get this code, log in to http://www.superwaba.com.br
On the download page, download "Part 1: Palm OS targets, javadocs, samples and
tools"
Unzip to a working directory.
You only need the following subdirectories:
SuperWabaSDK\src\superwaba\ext\xplat\xml
SuperWabaSDK\src\superwaba\ext\xplat\html
SuperwabaSDK\src\superwaba\ext\xplat\io\http
SuperWabaSDK\samples\io\HtmlBrowser

Pierre.

Thank you very much. I’ll try to solve my problem with the perl script. I think its really a bit ugly but it will do the job :slight_smile:

greets
Marc GerritzenOn Wed, 3 Nov 2004 00:15:50 +0000 (UTC) Nick wrote:

Marc Gerritzen <Marc.Gerritzen t-online.de> writes:

Hello,
At the moment I’m coding a visualisation-program for a solar-system on
top of the roof of our school.
The program should also be able to print out HTML-Sites, but I’m too lazy
to code a parser by myself. So does
anybody know a HTML-Parser-Libary for SDL or has another straightforward
solution?
Is it for example possible and practical to let Firefox draw the Page
in the Background and shoot an image of
the site parsed by Firefox and display it via SDL?
The program is going to run under Linux.

From what you describe, it sounds like you mean more than an HTML parser
(which would just examine the HTML code), you want an HTML rendering
engine. I don’t know of any that you could use personally, but I thought
I should clear that up for anybody who has some useful links or anything.
I don’t know if KHTML (used by Konqueror) would do the job.

Here’s a perl script I just found off google, seems to be a pretty hacky
way of capturing a page from Mozilla, but you might want to try it.
http://marginalhacks.com/Hacks/html2jpg/

and having said that, here’s a program that uses KHTML
http://www.babysimon.co.uk/khtml2png/index.html

Hope that helps (although none of it is to do with SDL!).

Nick H


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Slow down there Marc, let’s get some basics out of the way. You should
have been more clear about these things before emailing the SDL list.On Nov 2, 2004, at 12:36 PM, Marc Gerritzen wrote:

The program should also be able to print out HTML-Sites, but I’m too
lazy to code a parser by myself. So does anybody know a
HTML-Parser-Libary for SDL or has another straightforward solution?

If you described your task a bit more in detail, someone on the list
might be able to provide a better solution.

Right now you may think that the best solution is to render a webpage
and then display it using SDL, but someone may have a simpler, better
solution, if only you gave us more information about your situation.

Hello,
Sorry for the bad description but as I said my English is not the best, anyhow I’ll try to explain it a bit more in detail.
The teachers at my school want to upload a HTML-Page with News about the school e.g. and this page should be displayed from time to time. The rest of the time a SDL-program displays measured values(the HTML-Pages should be displayed by the SDL-program too).
So I was thinking about displaying a screenshot of the page. But it crossed my mind, that if the page is longer than the size of the screen there cant be any scrolling with a static picture.
I hape I now described the task a bit more in detail …On Thu, 4 Nov 2004 04:21:25 -0500 Donny Viszneki wrote:

Slow down there Marc, let’s get some basics out of the way. You should
have been more clear about these things before emailing the SDL list.

On Nov 2, 2004, at 12:36 PM, Marc Gerritzen wrote:

The program should also be able to print out HTML-Sites, but I’m too
lazy to code a parser by myself. So does anybody know a
HTML-Parser-Libary for SDL or has another straightforward solution?

If you described your task a bit more in detail, someone on the list
might be able to provide a better solution.

Right now you may think that the best solution is to render a webpage
and then display it using SDL, but someone may have a simpler, better
solution, if only you gave us more information about your situation.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello,
Sorry for the bad description but as I said my English is not the best, anyhow I’ll try to explain it a bit more in detail.
The teachers at my school want to upload a HTML-Page with News about the school e.g. and this page should be displayed from time to time. The rest of the time a SDL-program displays measured values(the HTML-Pages should be displayed by the SDL-program too).
So I was thinking about displaying a screenshot of the page. But it crossed my mind, that if the page is longer than the size of the screen there cant be any scrolling with a static picture.
I hape I now described the task a bit more in detail …

There is no reason why you can scroll an image that is larger than the
screen.

	Bob PendletonOn Thu, 2004-11-04 at 07:14, Marc Gerritzen wrote:

On Thu, 4 Nov 2004 04:21:25 -0500 Donny Viszneki wrote:

Slow down there Marc, let’s get some basics out of the way. You should
have been more clear about these things before emailing the SDL list.

On Nov 2, 2004, at 12:36 PM, Marc Gerritzen wrote:

The program should also be able to print out HTML-Sites, but I’m too
lazy to code a parser by myself. So does anybody know a
HTML-Parser-Libary for SDL or has another straightforward solution?

If you described your task a bit more in detail, someone on the list
might be able to provide a better solution.

Right now you may think that the best solution is to render a webpage
and then display it using SDL, but someone may have a simpler, better
solution, if only you gave us more information about your situation.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±-------------------------------------+

Hello,
Sorry for the bad description but as I said my English is not the best, anyhow I’ll try to explain it a bit more in detail.
The teachers at my school want to upload a HTML-Page with News about the school e.g. and this page should be displayed from time to time. The rest of the time a SDL-program displays measured values(the HTML-Pages should be displayed by the SDL-program too).
So I was thinking about displaying a screenshot of the page. But it crossed my mind, that if the page is longer than the size of the screen there cant be any scrolling with a static picture.
I hape I now described the task a bit more in detail …

There is no reason why you can scroll an image that is larger than the

That was suppose to say; There is no reason why you can not scroll an
image that is larger than the screen."On Thu, 2004-11-04 at 08:57, Bob Pendleton wrote:

On Thu, 2004-11-04 at 07:14, Marc Gerritzen wrote:

screen.

  Bob Pendleton

On Thu, 4 Nov 2004 04:21:25 -0500 Donny Viszneki wrote:

Slow down there Marc, let’s get some basics out of the way. You should
have been more clear about these things before emailing the SDL list.

On Nov 2, 2004, at 12:36 PM, Marc Gerritzen wrote:

The program should also be able to print out HTML-Sites, but I’m too
lazy to code a parser by myself. So does anybody know a
HTML-Parser-Libary for SDL or has another straightforward solution?

If you described your task a bit more in detail, someone on the list
might be able to provide a better solution.

Right now you may think that the best solution is to render a webpage
and then display it using SDL, but someone may have a simpler, better
solution, if only you gave us more information about your situation.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±-------------------------------------+

Marc, are you saying that you need a computer to display a solar
system, and also display a webpage? If so, why not make the solar
system display program separate from the webpage display? If you did
this, you could simply run a web browser separately from the solar
system viewer.On Nov 4, 2004, at 6:08 PM, Bob Pendleton wrote:

On Thu, 2004-11-04 at 08:57, Bob Pendleton wrote:

On Thu, 2004-11-04 at 07:14, Marc Gerritzen wrote:

So I was thinking about displaying a screenshot of the page. But it
crossed my mind, that if the page is longer than the size of the
screen there cant be any scrolling with a static picture.
I hape I now described the task a bit more in detail …

There is no reason why you can scroll an image that is larger than the

That was suppose to say; There is no reason why you can not scroll an
image that is larger than the screen."

Marc may have been implying that during the actual screenshot process,
some hacks might not support taking such a screenshot while taking into
account pages that are longer than one “page.”