1 (* Wrapper around Perl HTML::TreeBuilder class.
2 * Copyright (C) 2003 Merjis Ltd.
3 * $Id: pl_HTML_TreeBuilder.ml,v 1.2 2003-10-15 16:51:12 rich Exp $
11 let _ = eval "use HTML::TreeBuilder"
13 class html_treebuilder sv =
16 inherit html_parser sv
19 let sv = call_method sv "elementify" [] in
23 (* Note that "new" is a reserved word, so I've appended an _ character. *)
25 let sv = call_class_method "HTML::TreeBuilder" "new" [] in
26 new html_treebuilder sv
28 let new_from_file filename =
29 let sv = call_class_method "HTML::TreeBuilder" "new_from_file"
30 [sv_of_string filename] in
31 new html_treebuilder sv
33 let new_from_content content =
34 let sv = call_class_method "HTML::TreeBuilder" "new_from_content"
35 [sv_of_string content] in
36 new html_treebuilder sv