W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2004

Re: Validation of schema element with non-schema attribute

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Fri, 20 Feb 2004 09:58:42 +0000
To: "Noga Atsil" <Noga.Atsil@smarteam.com>
Cc: <xmlschema-dev@w3.org>, "Keren Friedman" <Keren.Friedman@smarteam.com>
Message-ID: <f5b7jyioywd.fsf@erasmus.inf.ed.ac.uk>

This one is tricky -- since you have used {NS}att as an attribute in
your schema document, you need the schema for NS available _when that
document is validated_.  The xs:import makes it available for
validating other instances, which is not the same thing.

With the following changes, XSV produces the expected error ('value'
is not a decimal):

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified" attributeFormDefault="unqualified"
	<xs:attribute name="att" type="xs:integer"/>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p="NS"
elementFormDefault="qualified" attributeFormDefault="unqualified"
   xsi:schemaLocation="NS NS.xsd">
	<xs:element name="myElement">
			<xs:attribute name="myAttribute" type="xs:string" p:att="value"/>

 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Friday, 20 February 2004 04:58:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:18 UTC