W3C home > Mailing lists > Public > www-xkms@w3.org > July 2004

Enumerations in schema

From: Berin Lautenbach <berin@wingsofhermes.org>
Date: Sun, 04 Jul 2004 18:58:54 +1000
Message-ID: <40E7C6CE.1090000@wingsofhermes.org>
To: www-xkms@w3.org

G'day all,

Am not sure if this has been raised before, but I've been playing with 
schema validation of the various messages and have run into a problem 
with Xerces rejecting messages because of the (amongst others) KeyUsage 
Elements.  In particular, the schema defines the KeyUsageType 
enumeration as follows :

	<simpleType name="KeyUsageType">
		<restriction base="QName">
			<enumeration value="xkms:Encryption"/>
			<enumeration value="xkms:Signature"/>
			<enumeration value="xkms:Exchange"/>
		</restriction>
	</simpleType>

I'm not a huge expert in XMLSchema, but my understanding is that 
enumeration values are literal.  So if I use a different qualifier (or 
even no qualifier) it will fail strict validation.

E.g. the snippet

<xk:KeyUsage 
xmlns:xk="http://www.w3.org/2002/03/xkms#">xk:Signature</xk:KeyUsage>

will fail, whereas

<xk:KeyUsage 
xmlns:xkms="http://www.w3.org/2002/03/xkms#">xkms:Signature</xkms:KeyUsage>

will succeed.

I think KeyBindingStatus will also have the same problem.

Am I misunderstanding XMLSchema?  If not - do we really need to 
enumerate these values in the schema?

Cheers,
	Berin
Received on Sunday, 4 July 2004 04:59:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 October 2009 08:39:22 GMT