You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by 鍞愪紵寮? <fl...@126.com> on 2008/05/30 05:20:30 UTC

Bug in validate choice

 Hi 
    
I use xerces to validate a xml according my schema
schema:
<xs:element name="people" nillable="true" minOccurs="0" maxOccurs="unbounded">
    <xs:complexType>
        <xs:sequence>
            <xs:choice>
                <xs:sequence minOccurs="0">
                    <xs:element name="ID" type="xs:string"/>
                    <xs:element name="Name" type="xs:string"/>
                    <xs:element name="Description" type="xs:string" minOccurs="0"/>
                    <xs:element name="isAvailable" type="xs:boolean"/>
                </xs:sequence>
                <xs:sequence minOccurs="0">
                    <xs:element name="Name" type="xs:string" minOccurs="0"/>
                    <xs:element name="Description" type="xs:string" nillable="true" minOccurs="0"/>
                </xs:sequence>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
</xs:element>

XML
<people>
    <Name>fd</Name>
    <Description xsi:nil="true"/>
</people>

The validation failed, the reason is "Message: xsi:nil must not be specified for the element Description with nillable equals false"
It seems it use the first "Description" definition to verify the second one.

BRs
Jason

Re: Bug in validate choice

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi,

> The validation failed, the reason is "Message: xsi:nil must not be specified for the element Description with nillable equals false"
> It seems it use the first "Description" definition to verify the second one.

Failed a bug report:

https://issues.apache.org/jira/browse/XERCESC-1810

Thanks,
Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde