Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: decimal and the totalDigits facet

From: "Zafar Abbas" <Zafar.Abbas@---------.--->
To: "Kasimier Buchcik" <K.Buchcik@---------.-->, "ML-xml-schema-dev" <xmlschema-dev@--.--->
Date: 10/19/2005 8:44:00 AM
You are right. This is an issue with MSXML4 which will be fixed in the =
upcoming latest release of MSXML.

Thanks,
Zafar

-----Original Message-----
From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] =
On Behalf Of Kasimier Buchcik
Sent: Wednesday, October 19, 2005 12:35 PM
To: ML-xml-schema-dev
Subject: xs:decimal and the totalDigits facet


Hi,

There's an inconsistency between some schema processors wrt xs:decimal
and the totalDigits facet. I think MSXML and Libxml2 have problems
computing the correct totalDigits for values < 0.

Scenario:

decimal.xsd
-----------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
=09
	<xsd:simpleType name="myDecimal">
		<xsd:restriction base="xsd:decimal">
			<xsd:totalDigits value="6"/>		=09
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:element name="foo">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="val" type="myDecimal"/>
				<xsd:element name="ref" type="myDecimal"/>
			</xsd:sequence>
		</xsd:complexType>

		<xsd:key name="myKey">
			<xsd:selector xpath="val"/>
			<xsd:field xpath="."/>
		</xsd:key>

		<xsd:keyref name="myKeyRef" refer="myKey">
			<xsd:selector xpath="ref"/>
			<xsd:field xpath="."/>
		</xsd:keyref>
	</xsd:element>

</xsd:schema>

decimal.xml
-----------
<foo
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="decimal.xsd">
	<val>0.000931</val>
	<ref>0.000931</ref>=09
</foo>

MSXML 4.0 SP2:
p:\libxml2-lab\tests\2005-10-19\decimal.xml:5,17:
totalDigits-Einschr=E4nkungsfehler.
Das Element 'val'  hat gem=E4=DF seinem Datentyp einen ung=FCltigen =
Wert.

(This means that it barks at the total digits of the instance).

Xerces-J 2.7.1:
no errors

XSV:
does not seem to handle the totalDigits facet.

Saxon 8.5.1:
validation error on line 7 column 7 of
file:/p:/libxml2-lab/tests/2005-10-19/decimal.xml:
  No referenced value found for keyRef {myKeyRef}: 0.000931

Libxml2 2.6.22:
Element 'val': [facet 'totalDigits'] The value '0.000931' has more
digits than are allowed ('6').

If we change totalDigits to "7", then MSXML and Libxml2 get happy
again.

According to [1], we have:
0.000931 = 931 =D7 10^-6
which satisfies the following:
|931| < 10^6 and 0 <= 6 <= 6

thus a totalDigits of "6" should cover this value and MSXML and
Libxml2 are wrong, correct?

[1] http://www.w3.org/TR/xmlschema-2/#dt-totalDigits

Regards,

Kasimier




From ht@i... Fri Oct 21 09:13:38 2005
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1ESsy2-0006m


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent