Re: enumerated and patterned QNames

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 UTC