Expand description
What each xs: primitive accepts.
Two callers need this and need to agree. Conversion asks how to carry a value
— whether 42 belongs in JSON as a number or a string — and validation asks
whether the value fits the type at all. Keeping the answer in one place is
what stops them from drifting: the XML reader once knew about xs:int and not
xs:unsignedInt, so the catalog’s most common integer type arrived at every
JSON client as a quoted string.
The lexical spaces here are XSD 1.0’s, Part 2. They are checked to the extent
that a value can be told apart from a value of another type, which includes
the calendar: 2026-02-30 is not a date, and saying so needs more than a
shape.
Enums§
- What a primitive accepts, in the terms conversion and validation both need.
Constants§
- DATE 🔒A four-or-more digit year, a month, and a day. Whether the day exists is
calendar’s question. - TIME 🔒Hours, minutes, and seconds with an optional fraction. Whether they are in range is
clock’s question. - ZONE 🔒
Z, or an offset up to 14 hours either way.
Statics§
Functions§
- calendar 🔒The parts of a date, once the shape is known to hold.
- clock 🔒The parts of a time, once the shape is known to hold.
- integral 🔒Digits with an optional sign, which is XSD’s lexical space for an integer.
- Whether this build can tell a value of this kind from anything else.
- What
primitiveaccepts. An unrecognized name is treated as text, which is whatKind::Textmeans: no opinion, rather than a guess. - pattern 🔒Compile a shape once, anchored, and keep it.
- Why
textis not a value of this kind, phrased as what was expected.