RE: XML Schema wildcard question

> -----Original Message-----
> From:	Ashok Malhotra []
> Sent:	Thursday, March 14, 2002 4:23 PM
> To:	by way of "C. M. Sperberg-McQueen" <>; W3C XML Schema
> Comments list
> Subject:	RE: XML Schema wildcard question
> No, sorry, that will not work.
> XML Schema has wildcards for anyElement and anyAttribute.  
> You are asking for a wildcard for anyValue which is not supported. 
Another way to describe what you're asking for is what was refered to as
"open" enumerations in the early design phase of the spec.  That is, a type
whose value space is the same as its base type, but for which certain values
are singled out as "special" via enumeration.

I have distinct use cases for such a feature, however, it has never been
easy to enumerate (pun intended :-) the validation implications of such a
type.  In other words, from the perspect of type validity, your
DeviceDataType *is* xsd:string.  You just want some way to tell document
authors that you'd prefer they choose a value from your enumeration if

One thing you can do is to use appinfo to enumerate the "prefered" values,
as in:

	<xsd:element name="DeviceDataType">
					<yourNS:prefered value='b'/>
					<yourNS:prefered value='f'/>
					<yourNS:prefered value='flag'/>
					<yourNS:prefered value='h'/>
					<yourNS:prefered value='i'/>
					<yourNS:prefered value='s'/>
	       <xsd:restriction base="xsd:string"/>

and then key all of your special processing off of that appinfo.

> -----Original Message-----
> From: by way of "C. M. Sperberg-McQueen" <>
> [] 
> Sent: Thursday, March 14, 2002 4:14 PM
> To: W3C XML Schema Comments list
> Subject: XML Schema wildcard question
> Is it possible to add a wildcard in the following XML schema enumeration
> example?
> <xsd:element name="DeviceDataType">
>      <xsd:simpleType>
>        <xsd:restriction base="xsd:string">
>          <xsd:enumeration value="b"/>
>          <xsd:enumeration value="f"/>
>          <xsd:enumeration value="flag"/>
>          <xsd:enumeration value="h"/>
>          <xsd:enumeration value="i"/>
>          <xsd:enumeration value="s"/>
>                            <xsd:enumeration value="*"/>
>        </xsd:restriction>
>      </xsd:simpleType>
>    </xsd:element>
> Will the enumeration line that contains:  value="*" match any value that
> wasn't equal to
> b, f, flag, h, i, or s?  Does a wildcard feature exist in XML Schemas?
> Thank you for your help,
> Maureen C. Harig

Received on Thursday, 14 March 2002 19:54:47 UTC