[uf-discuss] How to handle empty lists ?
lists at ben-ward.co.uk
Tue Oct 30 09:44:27 PST 2007
On 30 Oct 2007, at 17:09, michel.rousset at free.fr wrote:
> I'm new to microformats.
> I'm trying to use microformat style xhtml to represent some data.
OK. Howeber, what you're using is really semantic HTML, it's
precisely what the class attribute was designed for. Call it a
pattern or a data format as you like, but keep in mind that
‘microformats’ are a process by which formats are defined, not a
syntax in itself. The syntax you're using is just HTML.
> Somme data are lists of items represented by an <ul> element. XHTML
> (HTML) do
> not allow empty lists, but my data model uses empty lists.
> How to deal with this :
> - use an empty <span class="empty-list"> element,
> - use a fake element <ul><li class="ignore" /></ul>,
> - use empty list and ignore xhtml rule,
> - ... ?
To be pedantic, is an empty list really a list if it doesn't list
anything? For whatever pattern you are designing, why not just define
a parsing rule based on the absence of the list? If the list is
present, then you know that there is data, if it is absent then you
know there is not. Regardless of validation, including an empty list
in an HTML document is poor code really.
More information about the microformats-discuss