Re: managing unknown values

Ainsi parlait Bailey, Stephen :
> Guillaume,
>
> Tags that must be present, but the value is not known can be declared using
> the nillable attribute as follows...
>
> <xs:element name="foo" type="xs:integer" nillable="true"/>
>
>
>
> In the instance document, when the value is known you can declare the
> element
>
> <foo>25</foo>
>
>
>
> or when this element has unknown value you can declare the element
>
> <foo xsi:nil="true"/>
Exactly what i needed, thanks.

However, it fails in some cases...
Schema:
<element name="foo" type="KeyRefType" nillable="true"/>
<element name="bar" type="KeyRefType"/>
<complexType name="KeyRefType">
  <attribute name="idref" type="string"/>
</complexType>
Instance:
<foo xsi:nil="true"/>
<bar idref="idx"/>
Error message:
General Schema Error: xsi:nil must not be specified for the element bar with 
{nillable} equals 'false'.

I thought it was missing idref attribute in foo that was in cause, so i made 
it optional in KeyRefType, but that doesn't change anything. Morevoer, it's 
strange the message targets bar element when foo is the guilty (removing it 
solves the probelm). It this a bug in my validater (xerces-j 1.4.2) ?
-- 
Guillaume Rousse <rousse@ccr.jussieu.fr>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html

Received on Monday, 10 September 2001 13:38:23 UTC