Re: Parsing HTML documents?
Paolo Casarini <[email protected]> Mon, 17 Aug 2009 15:23:23 +0200
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <[email protected]> |
--===============1243954538== Content-Type: multipart/alternative; boundary=0016e6dee7676529f30471564e77 --0016e6dee7676529f30471564e77 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello Bradley, gdome2 works only with well formed XML documents, the only released modules (wrt DOM specifications) are Main, Events and XPath: the HTML module is an old, not working and not maintained implementation. If you deal only with well formed XHTML documents, you can use gdome2, otherwise, as Luca already said, libxml2 is the right choice for you. Best regards, Paolo. On Aug 16, 2009 10:59 PM, "Bradley Kite" <[email protected]> wrote: Hello. I have been looking for a C library that provides a DOM interface to parsed HTML documents, however I have been struggling to make it work the way that I'd like (probably because I'm trying to use it incorrectly, no doubt!). Firstly, can gdome be used to parse HTML documents? I am aware that its more geared towards XML, which, although similar, has obvious differences! In any case, I'm using one of the examples as a start, however I'm getting this error while calling parse(): parser error : StartTag: invalid element name <!doctype html><head><title> I guess the main question I have, is am I using the right tool? Or should I be using something more suited to HTML? If so, would any body have any recomendations? I need to be able to modify various components of the DOM, and it needs to be written in C (or C++, but preferably C). Many thanks -- Bradley Kite _______________________________________________ gdome mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gdome --0016e6dee7676529f30471564e77 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <p>Hello Bradley,</p> <p>=A0 gdome2 works only with well formed XML documents, the only released = modules (wrt DOM specifications) are Main, Events and XPath: the HTML modul= e is an old, not working and not maintained implementation.</p> <p>If you deal only with well formed XHTML documents, you can use gdome2, o= therwise, as Luca already said, libxml2 is the right choice for you.</p> <p>Best regards,<br> =A0 Paolo.<br> </p> <p><blockquote type=3D"cite">On Aug 16, 2009 10:59 PM, "Bradley Kite&q= uot; <<a href=3D"mailto:[email protected]">[email protected]</= a>> wrote:<br><br>Hello.<br> <br> I have been looking for a C library that provides a DOM interface to<br> parsed HTML documents, however I have been struggling to make it work<br> the way that I'd like (probably because I'm trying to use it<br> incorrectly, no doubt!).<br> <br> Firstly, can gdome be used to parse HTML documents? I am aware that<br> its more geared towards XML, which, although similar, has obvious<br> differences!<br> <br> In any case, I'm using one of the examples as a start, however I'm<= br> getting this error while calling parse():<br> <br> parser error : StartTag: invalid element name<br> <!doctype html><head><title><br> <br> I guess the main question I have, is am I using the right tool? Or<br> should I be using something more suited to HTML? If so, would any body<br> have any recomendations? I need to be able to modify various<br> components of the DOM, and it needs to be written in C (or C++, but<br> preferably C).<br> <br> Many thanks<br> <font color=3D"#888888">--<br> Bradley Kite<br> _______________________________________________<br> gdome mailing list<br> <a href=3D"mailto:[email protected]">[email protected]</a><br> <a href=3D"http://mail.gnome.org/mailman/listinfo/gdome" target=3D"_blank">= http://mail.gnome.org/mailman/listinfo/gdome</a><br> </font></blockquote></p> --0016e6dee7676529f30471564e77-- --===============1243954538== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ gdome mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gdome --===============1243954538==--