W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2001

Re: Restricting decimals

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Wed, 28 Nov 2001 07:53:47 +0100
Message-ID: <3C0489FB.80102@dyomedea.com>
To: xmlschema-dev <xmlschema-dev@w3.org>
Mike_Leditschke@nemmco.com.au wrote:

 > 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?


It depends if you want to restrict the value or the lexical space.

You can restrict the value space by setting the min and max values and
this should still allow 0000012.34000000000000000 (considered as
equivalent to 12.34).

If you want to work on the lexical space, you don't have any choice
since the patterns are the only facets working on the lexical space ;=)

Hope this helps.

Eric

 >
 > 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.
 >
 >
 >



-- 
See you in Orlando for XML 2001.
                                      http://www.xmlconference.net/xmlusa/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
Received on Wednesday, 28 November 2001 01:53:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 16 March 2009 11:13:19 GMT