[HLink Draft 2002-09-13] Eschew Magic Attribute Values

The HLink draft calls for each attribute of the <hlink> element to be
bimodal: the attribute value is either a direct literal or a pointer to
the value of an attribute in the element being described.

This is brittle design.  It calls for recognition of effectively "magic
syntax" within the value domain of the attribute taken as a literal.
There are cases where this is clearly harmless - as when the value domain
is an enueration of defined tokens (such as with the 'effect' attribute.)

However, if the value of an attribute is required to be a URI reference,
then AFAIK the value "@href" by itself is a perfectly legal URI reference
(albeit unusual), and consequently its interpretation as a "magic value"
referencing something else by name is inherently ambiguous.

Rather than relying on uniformly magic syntax across a number of value
domains, it would be better to drop the bimodality altogether and define
an attribute dedicated to the mapping function.

I have no talent for resonant names, so I nominate 'attmap'.  Its value is
defined to be a list of name tokens, where each pair is interpreted as a
mapping of corresponding values.  The first of each pair will thus be the
name of an attribute of the <hlink> element, the second a name of an
attribute of the definiendum.  

[Some details: There is an issue with the list having an odd number of
tokens; two rules are possible - either to subsume the function of the
'element' attribute into the first token, or to ignore the last token.   
There is an issue of duplicate definitions - only the first should count.
There is an issue of an attribute being defined both directly and through
the 'attmap' attribute - mandate that the attmap mapping is primary, the
direct specification only advisory.]

This technique is completely general, and requires no constraints on the
value domains of semantically significant attributes.  Here are the
relevant examples of 2.3 rewritten according to this modification:

1.  The definition of the <a href="..."> element in XHTML: 
       
<hlink namespace="http://www.w3.org/1999/xhtml"
       element="a"
       effect="replace"
       actuate="onRequest"
       attmap="locator href replacement target"/>
       
2. Defining <img/> in XHTML 
  
<hlink namespace="http://www.w3.org/1999/xhtml"
       element="img"
       effect="embed"
       actuate="onLoad"
       onFailure="warn"
       attmap="locator src"/>
<hlink namespace="http://www.w3.org/1999/xhtml"
       element="img"
       effect="new"
       actuate="onRequestSecondary"
       attmap ="locator longdesc"/>
<hlink namespace="http://www.w3.org/1999/xhtml"
       element="img"
       effect="map"
       actuate="onLoad"
       attmap="locator usemap"/>

3.  Defining <object> in XHTML 
  
<hlink namespace="http://www.w3.org/1999/xhtml"
       element="object"
       effect="embed"
       actuate="onLoad"
       onFailure="processChildren"
       onSuccess="ignoreChildren"
       attmap="locator data"/>
            
5.  Defining redirection: 
  
<hlink namespace="http://www.example.com/markup"
       element="redirect"
       effect="replace"
       actuate="onLoad"
       attmap="locator href"/>
       

Please, no magic syntax in values!

Received on Saturday, 14 September 2002 17:40:30 UTC