Validating xs:nonNegativeInteger in schema 1.0 with oXygen

This should cover W3C XML Schema, Relax NG and DTD related problems.
mhGLEIF
Posts: 43
Joined: Tue Jul 26, 2016 6:31 pm

Validating xs:nonNegativeInteger in schema 1.0 with oXygen

Post by mhGLEIF »

One last validation question for this week:

I'm trying to validate an instance containing

Code: Select all

<RecordCount>-78</RecordCount>
against the XML Schema 1.0 spec containing

Code: Select all

<xs:element name="RecordCount" type="xs:nonNegativeInteger">
<xs:annotation>
<xs:documentation>The number of data records in the file. Can be a positive whole (integer) number, or zero (0).</xs:documentation>
</xs:annotation>
</xs:element>
but oXygen is not giving me a validation error for the - even though it gives correct validation errors for non-numbers, empty or decimal points.

Am I indicating the negative integer wrongly in the test data? Have I defined the content type wrongly?

I also tried to define this based off of xs:int as below but again this didn't give an error for -78 etc.

Code: Select all

<xs:simpleType name="CountType">
<xs:annotation>
<xs:documentation>A count must be a whole number, equal to zero or more.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Validating xs:nonNegativeInteger in schema 1.0 with oXygen

Post by adrian »

Hi,

Both give me an error on -78 (they both work with 78). So it's something else, not the type declaration.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply