W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

RE: combining pattern values?

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Mon, 2 Oct 2000 16:41:25 -0700
Message-Id: <376E771642C1D2118DC300805FEAAF4386DEC4@pars-exch-1.ca.kp.org>
To: www-xml-schema-comments@w3.org
> -----Original Message-----
> From:	chuck.han@autodesk.com [SMTP:chuck.han@autodesk.com]
> Sent:	Friday, September 15, 2000 6:00 AM
> To:	www-xml-schema-comments@w3.org
> Subject:	combining pattern values?
> Hi,
> Is there some way to combine pattern values when defining a new
> simpleType?  For example, suppose I have a simpleType called
> IntegerString:
> 	<simpleType name="IntegerString" base="xsd:string">
> 		<pattern value="\d+">
> 	</simpleType>
> and a simpleType called UnitsString that can be expressed either as:
> 	<simpleType name="UnitsString" base="xsd:string">
> 		<enumeration value="cm"/>
> 		<enumeration value="in"/>
> 	</simpleType>
> Is there a way to create a simpleType based on these two simpeTypes that
> would allow the value, say "23cm".  Clearly it would be simple enough to
> create a simpleType on its own to support such an expression, but there
> are cases that the combination of simpleTypes would be desirable.
Yes, I can see how such funcationality might be useful, however, under the
current design there is no way to accomplish this and at this late stage is
it unlikely that the WG would reconsider opening the discussion up to allow
this in Version 1.  We will, however, consider this case for possible
inclusion in future versions.

In case your use case is strictly related to measurement units (the general
functionality implied by your specific example above is broader than the
measurement units case), we have received many requests for robust support
for measurement units in XML Schema.  While sentiment in the WG is not
unanymous, the majority of WG members have felt that handling measurement
units in the above fashion is not necessarily the best appoach, with a more
appropriate construction begin something like:

	<element name='size'>
		<complexType content='empty'>
			<attribute name='number' type='decimal'/>
			<attribute name='units'>
					<restriction base='NMTOKEN'>
						<enumeration value='cm'/>
						<enumeration value='in'/>

and instances such as:

	<size number='23' units='cm'/>

Received on Monday, 2 October 2000 19:49:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:49 UTC