On the possibility of using the HTML5 parser from C++

classic Classic list List threaded Threaded
2 messages Options
JDE
Reply | Threaded
Open this post in threaded view
|

On the possibility of using the HTML5 parser from C++

JDE
Dear all:

 Sorry if this is not the right group but it seemed to me the most
appropriate. If not, could please someone redirect me to the right one?

 My question is about the possibility of using the library contained
in the mozilla global tree under parser/htmlparser to parse a HTML5 file
(local file, not downloaded) from a C++ program and getting the DOM
tree so that my program can transform the HTML file.

 I have succesfully built Firefox, and consequently all the files in
parser/htmlparser. My questions are:

-In which library have their object code been included? Is it possible to
link an independet program that uses it?

-Is there any documentation from the author(s) of the library (apart from
the comments in the files themselves) the document the API?

 Thank you very much in advance for your responses.

  Juan

_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom
Reply | Threaded
Open this post in threaded view
|

Re: On the possibility of using the HTML5 parser from C++

Boris Zbarsky
On 2/14/13 10:48 AM, JDE wrote:
>   My question is about the possibility of using the library contained
> in the mozilla global tree under parser/htmlparser to parse a HTML5 file
> (local file, not downloaded) from a C++ program and getting the DOM
> tree so that my program can transform the HTML file.

First of all, parser/htmlparser is not an HTML5 parser.  It's the old
tagsoup parser.  The HTML5 parser is in parser/html.

Second, neither one is really designed as a standalone drop-in parser,
though the HTML5 parser is maybe closer to it...

> -In which library have their object code been included?

libxul.

> Is it possible to link an independet program that uses it?

Yes, probably, but you'll be pulling in all of libxul.

You may want to talk to Henri Sivonen about using the translate-to-C++
bits or http://about.validator.nu/htmlparser/ as part of your project...
that's basically what parser/html is.

-Boris
_______________________________________________
dev-tech-dom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-dom