OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: 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" <lubell@cme.nist.gov>
To: <relax-ng@lists.oasis-open.org>
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
> lubell@nist.gov
>
>
> ------------------------------------------------------------------
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: relax-ng-request@lists.oasis-open.org
>
>
>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC