- From: Eric van der Vlist <vdv@dyomedea.com>
- Date: Sat, 29 Sep 2001 21:23:17 +0200
- To: xmlschema-dev@w3.org
Playing with xs:any and xsi:type and testing the behavior of wildcards
with respect to xsi:type, I come over a test case that is failing over
the 3 validators I have on hand (I am on the plan to Scottsdale while I
am writing these lines).
XML:
<?xml version="1.0" encoding="UTF-8"?>
<any xmlns="http://xmlfr.org/any"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlfr.org/any strict.xsd">
<anything xsi:type="xs:string"/>
</any>
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">
<xs:element name="any">
<xs:complexType>
<xs:sequence>
<xs:any namespace="##any" processContents="strict" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The document should be valid per my understanding of the wildcard spec
[1] and especially:
<quote>
{process contents} controls the impact on ·assessment· of the
information items allowed by wildcards, as follows:
strict
There must be a top-level declaration for the item available, or the
item must have an xsi:type, and the item must be ·valid· as appropriate.
</quote>
[1] http://www.w3c.org/TR/xmlschema-1/#Wildcards
Results:
Xerces (1.5.1-1)
[Error] strict2.xml:3:34: General Schema Error: Grammar with uri:
http://www.w3.org/2001/XMLSchema , can not be found.
[Error] strict2.xml:3:34: Element type "anything" must be declared.
endDocument
XML Spy (4.0)
This file is not valid:
Element "anything" not defined in DTD/Schema
XSV (1.203/1.108)
<?xml version='1.0'?>
<xsv crash='true' docElt='{http://xmlfr.org/any}any'
instanceAssessed='true' instanceErrors='0' rootType='[Anonymous]'
schemaErrors='0' schemaLocs='http://xmlfr.org/any -> strict.xsd'
target='strict2.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.xsd' namespace='http://xmlfr.org/any'
outcome='success' source='schemaLoc'/>
<bug>validator crash during validation</bug>
</xsv>
Traceback (most recent call last):
File "/home/vdv/downloads/xsv/applyschema.py", line 1273, in ?
raise SchemaValidationError,res
__main__.SchemaValidationError: Traceback (most recent call last):
File "/home/vdv/downloads/xsv/applyschema.py", line 813, in runit
validate(e, t, s, ed)
File "/home/vdv/downloads/xsv/applyschema.py", line 45, in validate
validateElement(element, typedef, schema, eltDecl)
File "/home/vdv/downloads/xsv/applyschema.py", line 141, in
validateElement
validateChildTypes(element.chunkedChildren, schema, lax)
File "/home/vdv/downloads/xsv/applyschema.py", line 437, in
validateChildTypes
child.type.validate(child,schema,'element',child)
File "/home/vdv/downloads/xsv/applyschema.py", line 963, in av
validateElement(child,None,schema)
File "/home/vdv/downloads/xsv/applyschema.py", line 114, in
validateElement
validateElementSimple(element, type, schema, eltDecl)
File "/home/vdv/downloads/xsv/applyschema.py", line 169, in
validateElementSimple
return validateTextModel(element, type, schema, declaration)
File "/home/vdv/downloads/xsv/applyschema.py", line 347, in
validateTextModel
if vc:
UnboundLocalError: Local variable 'vc' referenced before assignment
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 Saturday, 29 September 2001 23:37:57 UTC