XSD datatype
xs:nonPositiveInteger
An integer of zero or less. Zero is allowed; positive values are not.
xs:nonPositiveInteger fixes maxInclusive at zero and remains unbounded below. It is the mirror of xs:nonNegativeInteger, with zero belonging to both types.
Use xs:negativeInteger when zero must be excluded rather than adding another facet by hand.
- Lexical space
- Optional sign and digits, with a value no greater than zero.
- Derives from
xs:integer- Category
- Numeric types
- Facets
- minInclusive, maxInclusive, minExclusive, maxExclusive, pattern, enumeration, whiteSpace, totalDigits, fractionDigits
The schema used
This is the exact schema the literals above are validated against. Paste it into the validator with one of them to see the result yourself.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="v" type="xs:nonPositiveInteger"/>
</xs:schema>Related
- xs:negativeIntegerAn integer strictly below zero. Zero, including -0, is rejected.
- xs:integerA whole number of unlimited size. It derives from xs:decimal, not from a machine int — so it has no range at all.
- xs:nonNegativeIntegerAn integer of 0 or more. The right type for counts, where zero is a real answer.
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.