Re: xsi:type and xs:all : second test case, same players, different errors.

> XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <test xmlns="http://xmlfr.org/any"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://xmlfr.org/any strict-ambig.xsd">
>         <element2 xsi:type="anyType"/>
>         <element2/>
> </test>
>
> XSD:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" targetNamespace="http://xmlfr.org/any"
> xmlns:any="http://xmlfr.org/any">
>         <xs:element name="test">
>                 <xs:complexType>
>                         <xs:sequence>
>                                 <xs:any namespace="##any" processContents="strict"/>
>                                 <xs:element name="element2" type="any:anyType"/>
>                         </xs:sequence>
>                 </xs:complexType>
>         </xs:element>
>         <xs:element name="element1" type="any:anyType"/>
>         <xs:simpleType name="anyType">
>                 <xs:restriction base="xs:string"/>
>         </xs:simpleType>
> </xs:schema>
>
> Xerces:
> Curiously (since "element2" hasn't been declared as global), xerces
> considers this document valid.

I don't really understand why it (in this case) would be different if element2 was
declared as global?

Cheers,
/Eddie

>
>
> XML Spy:
> element2 not defined (coherent with previous case).
>
> XSV:
> The fact to remove a reference to a datatype in the W3C XML Schema
> namespace cures the stacktrace and a new error appears:
>
> <?xml version='1.0'?>
> <xsv docElt='{http://xmlfr.org/any}test' instanceAssessed='true'
> instanceErrors='1' rootType='[Anonymous]' schemaErrors='0'
> schemaLocs='http://xmlfr.org/any -> strict-ambig.xsd'
> target='strict-ambig.xml' validation='strict' version='XSV 1.203/1.108
> of 2001/09/24 12:34:23' xmlns='http://www.w3.org/2000/05/xsv'>
> <schemaDocAttempt URI='strict-ambig.xsd'
> namespace='http://xmlfr.org/any' outcome='success' source='schemaLoc'/>
> <invalid char='2' code='cvc-elt.2.3' line='3'
> resource='strict-ambig.xml'>xsi:type {http://xmlfr.org/any}:anyType is
> not a subtype of the declared type None</invalid>
>
> Eric
> --
> See you in Scottsdale, Arizona.
>       http://xmlconnections.com/xml/xmlfall2001/speakers.asp#evandervlist
> ------------------------------------------------------------------------
> Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
> http://xsltunit.org      http://4xt.org           http://examplotron.org
> ------------------------------------------------------------------------

Received on Monday, 1 October 2001 21:20:50 UTC