Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: implementing redefines - additional test

From: "Michael Kay" <mike@--------.--->
To: "'Kasimier Buchcik'" <kbuchcik@---------.-->, "'XML-SCHEMA'" <xmlschema-dev@--.--->
Date: 8/13/2005 9:46:00 AM
I think, and Saxon thinks, that this is clearly an error:

Error at xs:simpleType on line 7 of file:/c:/temp/final7.xsd:
  Cannot refine the simple type base because it is not present in the
redefined schema

(It is problematic, of course, because the spec for redefine, like that for
include, is very muddled about whether you're loading a set of schema
components (a schema) or a schema document. It seems to be something in
between - you're loading a set of partially created schema components that
are still strongly linked to the schema document in which they were defined.
Until the spec sorts out this basic problem, it's going to be very hard to
specify redefine more precisely.)

Michael Kay 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Kasimier Buchcik
> Sent: 12 August 2005 17:41
> To: XML-SCHEMA
> Subject: implementing redefines - additional test
> 
> 
> Hi,
> 
> this is a supplement to the mail:
> http://lists.w3.org/Archives/Public/xmlschema-dev/2005Aug/0018.html
> 
> An additional _very_ interesting test; I'm still using XSV 2.10-1 and
> Xerces-J 2.7.1:
> 
> base.xsd
> --------
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 	<xs:simpleType name="base">
> 		<xs:restriction base="xs:integer">
> 			<xs:maxInclusive value="5"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:schema>
> 
> dummy.xsd (just defines a type "dummy")
> ---------
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">	
> 	<xs:simpleType name="dummy">
> 		<xs:restriction base="xs:string"/>
> 	</xs:simpleType>
> </xs:schema>
> 
> final7.xsd
> ----------
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">		
> 	<xs:include schemaLocation="base.xsd"/>
> 	<xs:redefine schemaLocation="dummy.xsd">
>         	<!-- Note that we are redefining "base",
> 		     but "base" is not in "dummy.xsd".
> 		-->
> 		<xs:simpleType name="base">
> 			<xs:restriction base="base">
> 				<xs:maxInclusive value="4"/>
> 			</xs:restriction>
> 		</xs:simpleType>
> 	</xs:redefine>	
> 	<xs:element name="foo" type="base"/>
> </xs:schema>
> 
> instance.xml
> ------------
> <foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:noNamespaceSchemaLocation="final7.xsd">
> 	5
> </foo>
> 
> Validation of instance.xml with final7.xsd
> ------------------------------------------
> 
> Xerces-J:
> instance.xml:5,7: (Error) cvc-maxInclusive-valid: Value '5' is not
> facet-valid with respect to maxInclusive '4' for type 'base'.
> instance.xml:5,7: (Error) cvc-type.3.1.3: The value '5' of 
> element 'foo'
> is not valid.
> 
> XSV:
> instance.xml:1,22: element content failed type check: 5 >4
> 
> 
> Although we redefine "dummy.xsd", which neither contains, nor
> includes/imports the "base" type, this type was somehow redefined;
> then the value "5" in the instance was recognized to be invalid.
> Is this the expected behaviour or a bug? Need the redefined
> component not to be found when following the schema graph, starting
> with the explicitely mentioned redefined document?
> If the behaviour is expected, then what's the sense of the
> schemaLocation attribute of a <redefine>, if we just need to
> <include> the component to be able to redefine it?
> 
> Regards,
> 
> Kasimier
> 
> 



From mike@s... Sat Aug 13 07:48:00 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1E


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent