DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5358>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5358

Schema: Lexical representation problem for double

           Summary: Schema: Lexical representation problem for double
           Product: Xerces-C++
           Version: 1.5.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


xerces: 1.5.2
Platform: SGI running IRIX 6.5
Compiler: MIPSpro Compilers: Version 7.30

Problem: 
Schema validation does not allow for a lexical representation of "0.0" for
double datatypes.  Given the following schema and xml file:

test.xsd
-----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>

  <!-- Definition of simple element types -->
  
  <xs:simpleType name="AltType">
    <xs:restriction base="xs:double">
      <xs:minInclusive value="0"/>
    </xs:restriction>
  </xs:simpleType> 

  <xs:element name="sparcs">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Alt" type="AltType"/>
     </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
-----------------------------------------------------------------------

test.xml
-----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<sparcs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
              xsi:noNamespaceSchemaLocation='test.xsd'>

  <Alt> 0.0 </Alt>

</sparcs>
-----------------------------------------------------------------------


The declaration of "<Alt> 0.0 </Alt>" causes SAX2Count to report the following
error:

-----------------------------------------------------------------------
% SAX2Count test.xml
Error at file test.xml, line 5, char 19
  Message: Datatype error: Type:InvalidDatatypeFacetException, Message: Value
'0.0' shall be in the range of '-2.2250738585072014E-308',
'2.2250738585072014E-308' .
-----------------------------------------------------------------------

If I change the element to "<Alt> 0 </Alt>", all is well.  Also, note that
<Alt>1.0</Alt> also works fine.

Note too that in test.xsd, if I set the xs:minInclusive value to be
"<xs:minInclusive value="0.0"/>", I get a similar error.

I believe that the error message is incorrect - the second range value should be
'2.2250738585072014E+308' (change the negative exponent to a positive)


Please email me if I can clear things up...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to