Re: Parsing HTML documents?
Bradley Kite <[email protected]> Thu, 20 Aug 2009 10:11:58 +0100
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <[email protected]> |
2009/8/17 Paolo Casarini <[email protected]>: > Hello Bradley, > > =A0 gdome2 works only with well formed XML documents, the only released > modules (wrt DOM specifications) are Main, Events and XPath: the HTML mod= ule > 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, > =A0 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 > Hi Luca and Paolo Many thanks for your responses. I have started using libxml2 and found it to be exactly what I require! Kind Regards -- Brad.