W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2003

Re: enumerated and patterned QNames

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 31 Oct 2003 09:54:52 +0000
Message-ID: <157519073227.20031031095452@jenitennison.com>
To: "Adam van den Hoven" <AvandenHoven@cucbc.com>
Cc: xmlschema-dev@w3.org

Hi Adam,

> I want to make an enumeration for a simple type based on a QName. I
> assume that I can do the following:
>
> <xs:restriction base="xs:QName" xmlns:md="http://www.example.net/schema/qnames#">
>         <xs:enumeration value="md:foo" />
>         <xs:enumeration value="md:bar" />
>         <xs:enumeration value="md:jim" />
> </xs:restriction>
>
> But I'm not really sure how I can do a pattern to do something similar. 

Why do you want to do a pattern to do something similar? A pattern
will restrict the lexical representation of the QName. Perhaps you
want to make sure that the QNames all use prefixes? In that case, as
well as the enumeration, add something like:

  <xs:pattern value="(\i\c*):(foo|bar|jim)" />

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 31 October 2003 04:55:11 GMT

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