From: Gerd S. <in...@ge...> - 2014-05-12 19:24:13
|
Am Donnerstag, den 08.05.2014, 20:00 -0400 schrieb Ashish Agarwal: > utop # let parse s = > Netchannels.with_in_obj_channel > (new Netchannels.input_string s) > Nethtml.parse > ;; > val parse : string -> Nethtml.document list = <fun> > > > utop # parse "<div><li></li></div>";; > - : Nethtml.document list = [Nethtml.Element ("div", [], []); > Nethtml.Element ("li", [], [])] > > > > > The list item isn't a child of the div. I appreciate the html is > ill-formed, but does Nethtml check for such things? There is a dtd object you can pass to the parser that specifies such details. If an element isn't allowed as a child of another element, the behavior is that the parents are closed until the new element can be inserted. Of course, this isn't the only resolution of the problem, e.g. you could also magically add an ul or ol element. So far I know, however, it has never been specified how to resolve bad HTML. Gerd > > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Ocamlnet-devel mailing list > Oca...@li... > https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ |