← Prev in month ← Prev in thread

Annotation isue: context-sensitive attribute default values

From
Josh Lubell <>
Date
2001-08-03T18:13:07+00:00
ID
006101c11c47$ab165db0$
Thread
Annotation isue: context-sensitive attribute default values
Unless I'm missing something, it appears that the annotations spec does not
permit attribute default values to be context-sensitive. I'd like to be able
to have a single attribute definition whose default value depends on where
the attribute is used.

One way to achieve this would be to allow an a:defaultValue attribute on a
<ref> element if the referenced <define> contains a single attribute
element.

Then I could do something like this:

<define name="salutationAttr">
  <attribute name="salutation">
    <data type="string"/>
  </attribute>
</define>

<element name="monarch">
...
  <ref name="salutationAttr" a:defaultValue="Your Majesty"/>
...
</element>

<element name="judge">
...
  <ref name="salutationAttr" a:defaultValue="Your Honor"/>
...
</element>

An alternative way to specify context-sensitive attribute default values
might be to allow an attribute to contain multiple <a:defaultValue>
elements, with each <a:defaultValue> specifying an Xpath expression as its
context.

For example,

<define name="salutationAttr">
  <attribute name="salutation">
    <a:defaultValue context="monarch" value="Your Majesty"/>
    <a:defaultValue context="judge" value="Your Honor"/>
    <data type="string"/>
  </attribute>
</define>

Regards,
Josh

Joshua Lubell, NIST
100 Bureau Drive, Stop 8263
Gaithersburg MD 20899-8263 USA
(301) 975-3563
← Prev in month ← Prev in thread