Hi All,
I am using the loadGrammar function for validating xml instances
against xml schema. But According to me instance is invalid but xerces
says it is valid.
*******************************XSD FILE ************************
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="doc">
<xsd:complexType>
<xsd:choice>
<xsd:element name="elem" type="elem"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="elem">
<xsd:choice>
<xsd:any maxOccurs="2"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>
****************************************************************
**************************XML FILE *****************************
<?xml version="1.0"?>
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="particlesB013.xsd"
xsi:schemaLocation="foo particlesB013_1.xsd">
<elem>
<b xmlns="foo"/>
</elem>
</doc>
*****************************************************************
According to me this instance is invalid because element 'b' which falls
in 'any' wildcard group with processContent = strict because by default
processContent is strict. But there is no declaration of element 'b' is
available in XSD file.
Please let me know why Xerces is saying valid instance to this. This
example is from MicroSoft's MSSchemaTestSuite test suite.
Thanks.
Regards,
Umesh