Validating xs:nonNegativeInteger in schema 1.0 with oXygen
Posted: Fri Nov 25, 2016 1:25 pm
One last validation question for this week:
I'm trying to validate an instance containing
against the XML Schema 1.0 spec containing
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.
I'm trying to validate an instance containing
Code: Select all
<RecordCount>-78</RecordCount>
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>
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>