Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > [XML Schema] Invalid constraint value ambiguity

Reply
Thread Tools

[XML Schema] Invalid constraint value ambiguity

 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      01-05-2006
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 xmlnss="http://www.w3.org/2001/XMLSchema">
<xs:element name="sample-elem" type="MyInteger" default="0" />
<xs:simpleType name="MyInteger">
<xs:restriction base="xs:decimal">
<xsattern 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

 
Reply With Quote
 
 
 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      01-05-2006
Stanimir Stamenkov wrote:

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


Seems I've already got a definitive answer from Sandy Gao on the
Xercec-J Users list, that it looks like hole in the spec. Still I would
welcome any additional comments, thank you.

--
Stanimir

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-using a simple type definition; with enumeration constraint andwithout enumeration constraint puvit82 XML 4 02-01-2008 03:46 PM
ambiguity of post-increment and post-decrement Mark Turney C++ 11 11-13-2006 04:41 PM
JAXB 2.0: ambiguity of underscoreHandling="asCharInWord" ciaran.mchale@iona.com XML 0 11-30-2005 04:55 PM
Crystal Dll vs GAC ambiguity problems Greg ASP .Net 0 09-01-2005 02:35 PM
XSD constraint : highest attribute value in an element Stone XML 0 11-24-2004 07:19 PM



Advertisments