I have an extensible schema that has various <xs:any namespace="##other"> elements. I then have a schema that defines the elements that can go in there. (In the real application, I use Schematron to control which of these elements can be included.) The instance document therefore specifies two schemas against which to validate, each for its own namespace. Whilst XSV and MSXML accept this, Xerces-J 2.4 and 2.5 do not.
Simple files that show this problem are main.xsd: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="urn:main" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:main" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="doc"> <xs:complexType> <xs:sequence> <xs:element name="a" type="xs:string"/> <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> ext.xsd: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="urn:ext" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ext" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="b" type="xs:positiveInteger"/> </xs:schema> instance.xml: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns="urn:main" xmlns:ext="urn:ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:main main.xsd urn:ext ext.xsd"> <a>String</a> <ext:b>123</ext:b> </doc> I am using rsXMLtest to control testing, and get the response: Line no: 4 Char no: 9 File: D:\SourceSafe\wwwroot\126-100-CORE\Markup\temp\instance.xml Description: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'ext:b'. I can see nothing wrong with the files, but this seems too simple a case for it to be a Xerces bug. As I say, MSXML and XSV are happy with this. I have tried reversing the order of the contents of the <xsi:schemaLocation> in the instance to rule out the test software only retrieving the first schema. It makes no difference. Any help appreciated before I report this as a bug. Regards Paul Spencer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
