[dsdl-discuss] Re: FW: [office-comment] Ambiguity problems caused by a:defaultValue

From: MURATA Makoto <murata@hokkaido.email.ne.jp>
Date: Tue May 13 2008 - 14:13:40 UTC

> Isn't the declaration of ID simple enough to let the implemter do what
> he has to do ?
>
> something like
>
> <declare-id context="simple_xpath | simple_xpath"/>
> <declare-idref context="simple_xpath | simple_xpath"/>
>
> isn't just sufficient ?

I suppose that you intend to create a tiny language for
identity constraints. I think that your goal is sensible.

W3C XML Schema provides multi-part keys: a selector may have
more than one field. These fields collectively become a key.
Although I do not think that multi-part keys are strongly
required, I would like to make sure that multi-part keys can
be easily added later. So, I think that we should separate
selectors and fields.

Here is my suggestion.

1. Example

<identityConstraints>
        <key name="...">
          <selector path="..">
            <field path=".."/>
          </selector>
        </key>
        <keyref name="..." keyName="....">
          <selector path="..">
            <field path=".."/>
          </selector>
        </keyref>
</identityConstraints>

2. Syntax

start = element identityConstraints { (key | keyref)*}
key = element key {attribute name {xsd:NCName}, selector }
selector = element selector { attribute path { text} , field}
field = element field { attribute path { text }}
keyref = element keyref {attribute name {xsd:NCName}, attribute keyName {xsd:NCName}, selector }
selector = element selector { attribute path { text} , field}
field = element field { attribute path { text }}

3. Design choices

Multi-part keys: No (unlike W3C XML Schema)
Hierarchical keys: No (as in W3C XML Schema)
Key scopes: Global only (unlike W3C XML Schema)
Typed keys: No (unlike W3C XML Schema)
Multiple key/keyref symbol spaces: Yes (as in W3C XML Schema)
Keys in elements: Yes (as in W3C XML Schema)
IDREF*S*. No (as in W3C XML Schema)
Separation from validation: Yes (unlike W3C XML Schema)
Mandatory keys: Yes (i.e., no xsd:unique)
More than one key per element is allowed.

P.S. you might want to have a look at the old archive of RELAX NG TC

http://lists.oasis-open.org/archives/relax-ng/200104/maillist.html

-- 
MURATA Makoto <murata@hokkaido.email.ne.jp>
--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Tue May 13 16:13:41 2008

This archive was generated by hypermail 2.1.8 : Tue May 13 2008 - 20:33:02 UTC