W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2002

RE: XML Schema wildcard question

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Thu, 14 Mar 2002 16:45:39 -0800
Message-Id: <8904C60CACA7D51191BC00805FEAAF4358EB46@crdc-exch-7.crdc.kp.org>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Cc: "'Maureen.Harig@apcc.com'" <Maureen.Harig@apcc.com>
> -----Original Message-----
> From:	Ashok Malhotra [SMTP:ashokma@microsoft.com]
> Sent:	Thursday, March 14, 2002 4:23 PM
> To:	by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>; 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
possible.

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

	<xsd:element name="DeviceDataType">
	     <xsd:simpleType>
			<xsd:annotatation>
				<xsd:appinfo>
					<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:appinfo>
			</xsd:annotation>
	       <xsd:restriction base="xsd:string"/>
	     </xsd:simpleType>
	   </xsd:element>

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

> -----Original Message-----
> From: by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>
> [mailto:Maureen.Harig@apcc.com] 
> 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
> 
> http://www.apc.com 
Received on Thursday, 14 March 2002 19:54:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:33 UTC