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

xsi:type and xsd:string confusion

From: Fraser Goffin <goffinf@hotmail.com>
Date: Sat, 24 Jan 2004 18:57:34 +0000
To: xmlschema-dev@w3.org
Message-ID: <Law10-F33S9iuG7Z2JQ00019109@hotmail.com>

If I define a simple type thus (a string constrained only in that it must 
have at least 1 character) :-

	<s:element name="CRN">
		<s:simpleType>
			<s:restriction base="s:string">
				<s:minLength value="1"/>
			</s:restriction>
		</s:simpleType>
	</s:element>

why is it that my validating parser reports that the following fragment 
which asserts the string type is invalid :-

<CRN xsi:type='xsd:string'>10165451</CRN>

the message output is :-

Use of type '{http://www.w3.org/2001/XMLSchema}string' is blocked on element 
'{http://www.xxx}CRN'

Is there a way of maintaining the minLength facet and allowing run-time type 
assertion like this ?

Fraser.

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection 
http://www.msn.co.uk/specials/btbroadband
Received on Saturday, 24 January 2004 13:59:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:41 GMT