W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

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

From: Eddie Robertsson <eddie@allette.com.au>
Date: Tue, 02 Oct 2001 11:26:29 +1000
Message-ID: <3BB917C5.F11E49DD@allette.com.au>
To: Eric van der Vlist <vdv@dyomedea.com>
CC: xmlschema-dev@w3.org
> 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT