[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: Wed, 28 Nov 2001 05:12:38 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB014885CD@red-msg-12.redmond.corp.microsoft.com>
To: <Mike_Leditschke@nemmco.com.au>, <xmlschema-dev@w3.org>
RE: Restricting decimals
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>

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


-----Original Message-----
From: Mike_Leditschke@nemmco.com.au
[mailto:Mike_Leditschke@nemmco.com.au] 
Sent: Tuesday, November 27, 2001 4:27 PM
To: xmlschema-dev@w3.org
Subject: Restricting decimals

I need to constrain a decimal value to have at most
two digits on either side of the decimal point,

e.g. 22.22

If I use totalDigits=4, fractionalDigits=2, this still
allows

1234. , 123.4 etc

Do I need to resort to a pattern or have I missed the
obvious?

Thanks
Michael


------------------------------------------
This e-mail is confidential.  If you are not the intended recipient, any
use, disclosure or copying of this document is unauthorised and
prohibited.  If you have received this document in error, please delete
the email and notify me by return email or by phoning the NEMMCO
Helpdesk on 1300 300 295.
Received on Wednesday, 28 November 2001 08:13:46 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.