- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 30 Nov 2001 16:57:56 +0000
- To: Tom Preston <tpreston@amadeusboston.com>
- Cc: "Ian.Mockford" <Ian.Mockford@rrl.co.uk>, "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Tom Preston <tpreston@amadeusboston.com> writes:
> I have been using XSV for the first time and had also run into this problem.
> I think that I understand why this is not an XSV bug, but here is another
> variation on the same theme. Consider the validation of this .xml file:
> ----------------
> <po:edt
> xmlns:po="http://www.emilygraham.com/java/other/editor2.xsd">true</po:edt>
>
> ----------------
> AGAINST this .xsd file (editor2.xsd):
> ----------------
>
> <schema targetNamespace="http://www.emilygraham.com/java/other/editor2.xsd"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:r="http://www.emilygraham.com/java/other/editor2.xsd"
> elementFormDefault="unqualified">
>
> <element name="edit">
> <simpleType>
> <restriction base="NMTOKEN">
> <enumeration value="true"/>
> <enumeration value="false"/>
> </restriction>
> </simpleType>
> </element>
>
> </schema>
>
> -----------------
>
> Notice that in the .xml file, I have spelled the "edit" element incorrectly.
> I have specified it with a fully qualified name in the xml file (po:edt).
> When the "edt" element is NOT FOUND in the xsd document specified by the po:
> qualifier, shouldn't validation fail? It seems like a fully qualified
> "undefined" variable to me. Instead of an error, XSV just goes into "lax"
> validation mode and says that everything is ok (because the file is well
> formed). This means that the po:edt never gets validated against the
> http://www.emilygraham.com/java/other/editor2.xsd file.
We've had several requests to allow validation invocation to include
an element name, and will probably do something like that in 1.1,
and/or allow invocation to request strict validation of the document
element. But you don't _always_ want that -- I might have an xhtml
document with some of my own stuff embedded in it, and I want to
validate my stuff even though I don't have a schema for xhtml. So lax
validation is just right -- it will scan the whole document, looking
for bits it _can_ validate, and then validating them.
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 Friday, 30 November 2001 11:58:02 UTC