W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

RE: String Lists

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Fri, 1 Dec 2000 14:20:15 -0800
Message-Id: <376E771642C1D2118DC300805FEAAF43014BA80F@pars-exch-1.ca.kp.org>
To: "'Kollu, Kishore'" <kishore_kollu@mentorg.com>, "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
> -----Original Message-----
> From:	Kollu, Kishore [SMTP:kishore_kollu@mentorg.com]
> Sent:	Friday, December 01, 2000 2:01 PM
> To:	'www-xml-schema-comments@w3.org'
> Subject:	String Lists
> 
> Hi,
>  I am trying to use list of strings in schema. I set the value of facet
> length to 5.
> 
> In the instance document if I have a list 
> <MyList>a b c d e</MyList>, the IDE (XML Spy 3.5 beta 2) complains
> that the value does not match the facet length = 5.
> But if the same list is <MyList>abcde</MyList> then it does not complain.
> 
First, I have to ask, what does your schema fragment look like?  In other
words, it all hinges on HOW you've defined "a list of strings with length
facet = 5".  You may not have defined the type you thought you did.

Is your schema fragment something like the following:

<element name='MyList'>
	<simpleType>
		<restriction>
			<simpleType>
				<list itemType='string'/>
			</simpleType>
			<length value='5'/>
		</restriction>
	</simpleType>
</element>

If so, then the instance fragment:

	<MyList>a b c d e</MyList>

should validate properly and

	<MyList>abcde</MyList>

is schema invalid, and hence, the error would appear to be in XML Spy's
implementation.

If however, your schema fragment looks something like:

<element name='MyList'>
	<simpleType>
		<restriction base='string'>
			<length value='5'/>
		</restriction>
	</simpleType>
</element>

then <MyList>a b c d e</MyList> should be invalid, but
<MyList>abcde</MyList> should validate just fine and XML Spy's behavior
would be correct.

If your schema fragment looks different than either of the above I'd like to
know..

pvb
Received on Friday, 1 December 2000 17:34:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT