[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: Issue: empty strings as keys and keyRefs
When we discussed this at the telcon, there was some talk of dealing with
this in the restricted grammar. I don't think this works, because it
wouldn't deal with:
<choice>
<element name="foo">
<key name="x">
<data type="string"/>
</key>
</element>
<element name="foo">
<empty/>
</element>
</choice>
We could try to extend 7.4 to deal with this, but I think it's going to be
very tricky because we need to allow
<list>
<zeroOrMore>
<keyRef name="x">
<data type="string"/>
</keyRef>
</zeroOrMore>
</list>
which will turn into a <choice> with <empty/>.
Also it also seems a little tricky to implement empty strings as keys. No
doubt it can be done, but it's definitely extra work for an implementation.
I therefore continue to believe that the best solution is what is I've put
in the spec: putting not(s = "") in the antecedent to key and keyRef in
6.2.12.
James
--On 02 July 2001 10:55 +0700 James Clark <jjc@jclark.com> wrote:
> We need to think about what happens if an element with key or keyRef
> content has an empty string. For example, if the schema has:
>
> <element name="foo">
> <choice>
> <empty/>
> <key name="bar">
> <data type="string"/>
> </key>
> </choice>
> </element>
>
> and the instance has
>
> <foo></foo>
>
> then it is ambiguous what the key generated by the match is. One the
> other hand I don't think our ambiguity algorithm handles this.
>
> I think the simplest solution will be to say that <key> and <keyRef>
> don't match empty strings even if the included pattern can match an empty
> string, eg
>
> <element name="foo">
> <key name="bar">
> <data type="string"/>
> </key>
> </element>
>
> does not match
>
> <foo></foo>
>
> James
>
>
>
>
>
> ------------------------------------------------------------------
> 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