unexpected nethtml parsing behavior

Ashish Agarwal <[email protected]> Thu, 8 May 2014 20:00:29 -0400
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <CAMu2m2LC8qvaYnBYZrhfLBw3=dREgEPU2wssisypTN9p3bYx3A@mail.gmail.com>
--===============2897499287476234757==
Content-Type: multipart/alternative; boundary=001a11c3dc4856debf04f8ec4a7e

--001a11c3dc4856debf04f8ec4a7e
Content-Type: text/plain; charset=UTF-8

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?

--001a11c3dc4856debf04f8ec4a7e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>utop # let parse s =3D</div><div>=C2=A0 Netchannels.w=
ith_in_obj_channel</div><div>=C2=A0 =C2=A0 (new Netchannels.input_string s)=
</div><div>=C2=A0 =C2=A0 Nethtml.parse</div><div>;;</div><div>val parse : s=
tring -&gt; Nethtml.document list =3D &lt;fun&gt;</div>

<div><br></div><div>utop # parse &quot;&lt;div&gt;&lt;li&gt;&lt;/li&gt;&lt;=
/div&gt;&quot;;;</div><div>- : Nethtml.document list =3D [Nethtml.Element (=
&quot;div&quot;, [], []); Nethtml.Element (&quot;li&quot;, [], [])]</div>

<div><br></div><div><br></div><div>The list item isn&#39;t a child of the d=
iv. I appreciate the html is ill-formed, but does Nethtml check for such th=
ings?</div><div><br></div></div>

--001a11c3dc4856debf04f8ec4a7e--


--===============2897499287476234757==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
--===============2897499287476234757==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel

--===============2897499287476234757==--