Re: XSV - possible bug with XSV type checking

"Ian.Mockford" <Ian.Mockford@rrl.co.uk> writes:

> Not sure if this is a bug with XSV or a misapprehension on my part,
> but if I validate a schema with lines like:

>    <xsd:attribute name="id" type="xsd:ForceBreak" use="required" />
>    <xsd:attribute name="year" type="xsd:integer" use="required" />
> 
> I would expect a failure because I wouldn't expect
> [type="xsd:ForceBreak"] to be acceptable because it is not an xsd:
> type.  This came to light when I had a schema that contained
> type="xsd:real", which another tool (Xerces?) did not like (quite
> rightly by my interpretation of XML Schema spec).

I presume you're saying that XSV did _not_ complain, and that's what
surprised you.

> So I would be interested in knowing whether this is a bug or a known
> behaviour that has a sensible reason behind it. If the latter, it
> might be worth posting something with the XSV to explain it.

This is not a bug, it's the way W3C XML Schema is defined.  There are
two ways in which the first attribute above is not broken:

 1) It's valid per the schema for schemas: it has only allowed
    attributes, it has all the required attributes, the values of the
    attributes satisfy their type definitions.

 2) It _may_ be used in a complex type definition which is never
    actually needed in the validation of a particular instance.

So if you just asked XSV to validate your schema document, it doesn't
complain.  Perhaps when you came to actually use it, you'd also supply
a schema document which defined the missing ForceBreak type.  On its
own, the document is fine as a schema document, and it _could_
contribute to a well-specified schema.

If you have XSV installed locally you can use the -i flag to signal
you would like XSV to assume that the schema documents it's looking at
are _all_ the schema documents it would have for some validation
episode.  In that case you would get the error.

If you try to _use_ that schema document to validate an instance, it
may or may not complain, depending on the instance.

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 Thursday, 29 November 2001 12:16:05 UTC