Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema] Invalid constraint value ambiguity

From: "Stanimir Stamenkov" <stanio@---.-->
To: NULL
Date: 1/5/2006 6:57:00 AM
This is an issue I've got using the Xerces-J 2.7.1 release when loading
the following schema:

<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="sample-elem" type="MyInteger" default="0" />
   <xs:simpleType name="MyInteger">
     <xs:restriction base="xs:decimal">
       <xs:pattern value="[\-+]?[0-9]+" />
     </xs:restriction>
   </xs:simpleType>
</xs:schema>

Xerces gives me an error:

e-props-correct.2: Invalid value constraint value '0' in element
'sample-elem'.

I've tried the XML Schema Validator on the W3C site and it gave me no
error.

So I've initially posted on the Xerces-J Users list [1] and I was
pointed the default value should be also valid to the canonical lexical
representation of the datatype [2], where "0" have to be "0.0"
(according to the canonical lexical representation of the 'decimal'
type), but then it is not valid to the pattern specified, so schema as
the given one is effectively invalid.

Now as far as I understand the spec, the default value should be valid
according to the canonical lexical representation of the "MyInteger"
type and not the 'decimal' one, but then how is the canonical lexical
representation of user defined types determined, is it specified at
all?

[1] "[XML Schema] Invalid constraint value error (bug?)"
<http://mail-archives.apache.org/mod_mbox/xerces-j-users/200601.mbox/browser>

[2] http://www.w3.org/TR/xmlschema-1/#e-props-correct



transparent
Print
Mail
Like It
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