[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Restricting decimals

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Fri, 30 Nov 2001 09:27:29 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB0104073B@red-msg-12.redmond.corp.microsoft.com>
To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
Cc: <Mike_Leditschke@nemmco.com.au>, <xmlschema-dev@w3.org>
xml schema fractionaldigits
Henry:
The restriction he wanted was two digits before the decimal point
and two after.  Your solution does not restrict the digits after
the decimal point.

The following would work: 

<simpleType name='myDecimal'>
     <restriction base='decimal'>
       <fractionalDigits = '2'/>
       <maxExclusive value='100'/>
       <minExclusive value='-100'/>
     </restriction>
 </simpleType>

All the best, Ashok 
===========================================================
Ashok Malhotra              <mailto: ashokma@microsoft.com> 
Microsoft Corporation


-----Original Message-----
From: Henry S. Thompson [mailto:ht@cogsci.ed.ac.uk] 
Sent: Friday, November 30, 2001 8:54 AM
To: Ashok Malhotra
Cc: Mike_Leditschke@nemmco.com.au; xmlschema-dev@w3.org
Subject: Re: Restricting decimals

"Ashok Malhotra" <ashokma@microsoft.com> writes:

> You need a pattern to restrict the lexical form.  Try something like:
> 
> <simpleType name='myDecimal'>
>     <restriction base='decimal'>
>       <pattern value='\d{2}.\d{2}'/>
>     </restriction>
> </simpleType>

Sorry if this is a misunderstanding, but surely

 <simpleType name='myDecimal'>
     <restriction base='decimal'>
       <maxExclusive value='100'/>
       <minExclusive value='-100'/>
     </restriction>
 </simpleType>

would be somehow more appropriate?

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of
Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Friday, 30 November 2001 12:28:37 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.