Re: Detecting of schema errors

Mike_Leditschke@nemmco.com.au writes:

> I have the following two definitions in a schema. You'll notice the
> second is using a hyphen not an underscore as per the pattern.
> 
>      <xsd:simpleType name="ReleaseIdentifier">
>           <xsd:restriction base="xsd:string">
>                <xsd:pattern value="r[0-9]*|r[0-9]*_[a-z][0-9]*"/>
>           </xsd:restriction>
>      </xsd:simpleType>
> 
>      <xsd:simpleType name="r3">
>           <xsd:restriction base="ReleaseIdentifier">
>                <xsd:enumeration value="r3-e3"/>
>           </xsd:restriction>
>      </xsd:simpleType>
> 
> Should the parser flag an error when loading the schema, or only
> when validating an instance based on a schema using r3?

The second restriction is not allowed -- it's a schema error.

> Both XMLSpy 4.0b1 and XSV happily ignore the error as far as the
> schema is concerned.
> 
> XMLSpy reports an error when validating an instance even if the value
> "r3-e3" is provided, saying that it doesn't match the regular expression.
> 
> XSV is happy provided the instance uses the string "r3-e3" and
> doesn't report the value as violating the regular expression. Is
> this a bug? I recall that regular expressions were not supported in
> XSV a while back but they are not mentioned in the "Not Implemented
> yet" section of the latest status page.

Regexp support is not there -- this is meant to be understood by the
blanket "most simple types" entry in the Not Implemented yet section
-- sorry.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Monday, 25 June 2001 03:33:19 UTC