Next in thread → Next in month →

Re: Annotation isue: context-sensitive attribute default values

From
James Clark <>
Date
2001-08-04T04:07:02+00:00
ID
00d501c11c9a$96563d20$
Thread
Re: Annotation isue: context-sensitive attribute default values
I think the common annotations spec should not go beyond XML 1.0, so I am
opposed to adding this functionality.

There is nothing wrong with having a more sophisticated default value
mechanism, which handles context-sensntivity, as you suggest, or other
things, such as default element values.  However, I think that should be
left for a separate spec.

----- Original Message -----
From: "Josh Lubell" <>
To: <>
Sent: Saturday, August 04, 2001 1:11 AM
Subject: 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
> 
>
>
> ------------------------------------------------------------------
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: 
>
>
>
Next in thread → Next in month →