Hacker Newsnew | comments | show | ask | jobs | submitlogin

what does "HTML serialization" mean?



This might help: http://answers.oreilly.com/topic/983-html-5-overview/

This as well: http://stackoverflow.com/questions/256953/html-5-versus-xhtm...

Basically, the spec says, for example, that HTML5 has an 'html' element, and it may contain a 'head' and a 'body' element. (I'm winging it here.) And the 'head' element may optionally contain one or more 'meta' elements with attributes ... whatever.

So far so good; the spec defines the structural items. But it also says, look, you can manifest, or serialize, this using XML (i.e. XHTML) syntax, in which case you need to have true, proper XML (and that means, for example, that empty elements such as 'meta' or 'br' must be closed, typically using the ' />' stuff). Or you can use HTML syntax, in which case there are a set of empty elements ('meta', 'br', 'img', for example) that do not need an end tags or that ' />' thing.

Also see: http://hixie.ch/advocacy/xhtml

It comes down to what you think browsers are going to do based on what you send them.

-----




Guidelines | FAQ | Support | API | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: