Re: Issue: empty strings as keys and keyRefs

From
James Clark <>
Date
2001-07-10T05:58:42+00:00
ID
029e01c10905$1cd1ea10$
Thread
Re: Issue: empty strings as keys and keyRefs
> > 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,
>
> "" (the string of length 0) is not the only one. To be precise, "empty
> string" is a string that consists of #x20,#xD,#xA.
>
> Because patterns like
>
> <element name="foo">
>   <choice>
>     <empty/>
>     <key>
>       <data type="string">
>     </key>
>   </choice>
> </element>
>
> and an instance <foo>   &xD;  </foo> is still ambiguous.

Right, but we don't have to deal with that in the inference rule for key and
keyRef because of the stripSpace() in 6.2.8.

I believe it is sufficient to add

  not(s = "")

as an antecedent to (key) and (keyRef) rules in 6.2.12.

James