Wednesday, April 30, 2014

[hndhyewy] HTML without attributes

Create a variant of HTML (and XML) which foregoes attributes on a tag, instead replacing them with additional elements inside the tag, for example, <img> <src> foo.png </src> <alt> A <b>ferocious</b> foo! </alt> <width> 360 </width> <height> 256 </height> </img>.  The original motivation was to allow markup on attribute values, as demonstrated in the alt tag.  It makes the language more aesthetically regular.

It does become trickier to specify values which have spaces in them, for example a filename with leading spaces.  Perhaps use numeric entity syntax, or a new element, the only one permitted to have an attribute: <src> <literal string="   filename.jpg"> </src>

No comments :