[
Lists Home |
Date Index |
Thread Index
]
- From: johns@syscore.com (John F. Schlesinger)
- To: 'Ramesh Gupta' <ramesh@eNode.com>, xml-dev@xml.org
- Date: Wed, 18 Oct 2000 14:02:13 -0400
Ramesh,
I get the same problem. When I tried 23, 0.5, 23.00, 1.0E1, 1.1E1, 23E10
and -0.5 it still validated. When I tried 'hello' I got the following error:
"[Error] floattest.xml:5:9: Datatype error: Hello
is not a float.."
It looks like this facet is not supported in Xerces 1.2.
I used the following command and files:
command: java sax.SAXCount -v floattest.xml
floatTest.xsd
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/1999/XMLSchema"
targetNamespace="floatTest"
xmlns:my="floatTest"
elementFormDefault="unqualified"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:schemaLocation=
"http://www.w3.org/1999/XMLSchema
http://www.w3.org/1999/XMLSchema.xsd">
<!-- ========== -->
<simpleType name="myType" base="float" derivedBy="restriction">
<minInclusive value="0.0"/>
<maxInclusive value="1.0"/>
</simpleType>
<element name="x" type="my:myType"/>
<!-- ========== -->
</schema>
floatTest.xml
<?xml version="1.0"?>
<my:x xmlns:my="floatTest"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:schemaLocation="floatTest floatTest.xsd">23
</my:x>
Yours,
John F Schlesinger
SysCore Solutions
212 619 5200 x 219
917 886 5895 Mobile
-----Original Message-----
From: Ramesh Gupta [mailto:ramesh@eNode.com]
Sent: Friday, October 13, 2000 1:00 PM
To: xml-dev@xml.org
Subject: minInclusive/maxInclusive don't work for float
In a schema I have:
<!-- ========== -->
<simpleType name="myType" base="float" derivedBy="restriction">
<minInclusive value="0.0"/>
<maxInclusive value="1.0"/>
</simpleType>
<element name="x" type="my:myType"/>
<!-- ========== -->
In an instance document, I have:
<x>23</x>
With Xerces 1.2.0, this is validated without any errors. Any clues, anybody?
TIA,
Ramesh
|