RE: String Lists

> -----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 UTC