[Petal] attributes question

Jean-Michel Hiver jhiver at mkdoc.com
Sun Jul 27 14:45:07 BST 2003


> There are times when people need to produce a tag like tag="". I think there 
> are some tags in HTML that should never contain a value, for example the 
> selected tag in
> 
> <option name="aaa" value="bbb" selected>

I don't think this is well-formed XML. The correct XHTML way of doing it
is to have selected="selected".

  http://www.w3.org/TR/xhtml1/#h-4.5

I yet have to come across an instance where having an empty string
rather than deleting the entire attribute would make the output invalid.

If and only if there is such an instance then I think Petal should
delete the attribute if the variable is undef, or replace it by an empty
string if it's an empty string.

Cheers,
Jean-Michel.


More information about the Petal mailing list