alt element (was: naming custom/extended tags)

Arjun Ray wrote:
> > Some such convention is a good idea, although I'm not sure I like
> > yours.  An <alt> element, and an html:alt="" attribute for short,
> > might cover the same ground better.
> 
> I'm not sure what the attribute means, but I see no reason to
> introduce factitious elements into the document hierarchy where an
> attribute would do the job.

'htign' does one job; 'alt' would do that job and a little more, and I
think it would solve a few other minor problems.  The choice between
'htign' and 'alt' is, imho, one of complexity:  is 'alt' too complex
for UAs to implement?

An <alt> element wouldn't be any more "factitious" than, say, <noframes>
or the use of <object>'s children as alternate content.

'alt' would provide a way for the author to tell the UA what to use
and what to ignore when it finds an unsupported tag.  It lets the author
provide useful fallback content, if appropriate (htign wouldn't.)  The
rules would be:

   On finding an unsupported element:
   - If one of its children is an <alt> element, use its contents and
     ignore the unrecognized element and all its other children.
   - If the html:alt attribute is present, use its contents as text,
     and ignore the rest of the unrecognized element.
   - Otherwise, ignore the unrecognized attributes on the element,
     and process the children in an implementation-defined
     manner (but try not to ignore them.)

   On finding an html:alt attribute or <alt> element anywhere else,
   ignore it.

["use" and "ignore" will be defined in a later draft (0.7 wink)]

When using tags that some UAs won't understand, you could define an
attribute (in the DTD) that defaults html:alt to the empty string.
This would be like defaulting htign to "yes" (or whatever) under your
proposal.

If the server has a profile of the client's capabilities, <alt> can be
processed server-side (whether this is even remotely desirable is
questionable of course.)

-- 
Jason Orendorff

Received on Monday, 14 February 2000 11:15:42 UTC