From: Ashish A. <aga...@gm...> - 2014-05-05 13:25:54
|
The HTML5 reference [1] states that attribute values can be omitted, and that this is equivalent to giving the empty string as the value. I can't seem to find the rules in the HTML4 spec [2]. Does Nethtml allow specifying which version of HTML is being parsed/printed? If the spec has changed, I'm not sure how you want to handle the conflict. [1] http://www.w3.org/TR/html5/syntax.html#attributes-0 [2] http://www.w3.org/TR/html401/ On Sun, May 4, 2014 at 4:40 PM, Gerd Stolpmann <in...@ge...>wrote: > The parser does so because the HTML-4 standard (don't know whether > HTML-5 changed this) explicitly specifies that a value-less attribute > must be handled like this. > > Maybe that should be configurable. The spec could go into the dtd, and > it would just include all standard cases, so that attributes outside the > standard are not affected. > > Gerd > > Am Freitag, den 02.05.2014, 17:06 -0400 schrieb Ashish Agarwal: > > Html like "<div data-id></div>" gets parsed as: > > > > Nethtml.Element ("div", [("data-id", "data-id")], []) > > > > > > The value is set to the attribute name, which seems wrong. The correct > > solution would be to change the type of an element so that values are > > `string option`, but I'm guessing that's infeasible. Alternatively, > > the parser should set the value to the empty string. > > > > > > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > > Instantly run your Selenium tests across 300+ browser/OS combos. Get > > unparalleled scalability from the best Selenium testing platform > available. > > Simple to use. Nothing to install. Get started now for free." > > http://p.sf.net/sfu/SauceLabs > > _______________________________________________ > > 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 > ------------------------------------------------------------ > > > |