Re: managing unknown values

Ainsi parlait Mike_Leditschke@nemmco.com.au :
> You may already have received an answer to this one but it looks to me
> like you need to include a prefix on the definition of nillable in your
> schema. I suspect the parser is not seeing the nillable attribute in
> the correct namespace.

Testing this hypothesis with following schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  elementFormDefault="qualified"
>
        <xs:complexType name="KeyRefType">
                <xs:attribute name="idref" type="xs:string"/>
        </xs:complexType>

        <xs:complexType name="test">
                <xs:sequence>
                        <xs:element name="foo" type="KeyRefType" 
minOccurs="0" xsi:nillable="true"/>
                        <xs:element name="bar" type="KeyRefType" 
minOccurs="0"/>
                </xs:sequence>
        </xs:complexType>

        <xs:element name="test" type="test"/>
</xs:schema>

Still result in the infamous message, this time about foo (not bar) element
[guillaume@silbermann guillaume]$ xml-check instance.xml
[Error] instance.xml:3:30: General Schema Error: xsi:nil must not be 
specified for the element foo with {nillable} equals 'false'.
instance.xml: 680 ms (3 elems, 4 attrs, 19 spaces, 0 chars)

However, i just found setting bar to nillable also removes the message:
<xs:element name="foo" type="KeyRefType" minOccurs="0" nillable="true"/>
<xs:element name="bar" type="KeyRefType" minOccurs="0" nillable="true"/>
While setting it to false to any of them triggers the message vs the 
concerned element.
-- 
Guillaume Rousse <rousse@ccr.jussieu.fr>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html

Received on Tuesday, 11 September 2001 05:01:51 UTC