Skip to content

JSON Schema for XML Schema

Alexey Valikov edited this page May 2, 2015 · 2 revisions

JSON Schema for XML Schema

Generated schemas reference types from the standard pre-defined XML Schema:

http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema

The table below explains how XML Schema types will be represented in JSON Schema.

XML Schema type JSON Schema representation
anySimpleType string, number, integer, boolean, null
string string or null
normalizedString string with special pattern
token string with special pattern
language string with special pattern
Name string with special pattern
NCName string with special pattern
ID string with special pattern
IDREF string with special pattern
IDREFS array of strings with special pattern
ENTITY string with special pattern
ENTITIES array of strings with special pattern
NMTOKEN string with special pattern
NMTOKENS array of strings with special pattern
boolean boolean
base64Binary array of unsignedByte
hexBinary array of unsignedByte
float number
decimal number
integer integer
nonPositiveInteger integer with "maximum":0 and "exclusiveMaximum":false
negativeInteger integer with "maximum":0 and "exclusiveMaximum":true
long integer from -9223372036854775808 to 9223372036854775807
int integer from -2147483648 to 2147483647
short integer from -32768 to 32767
byte integer from -128 to 127
nonNegativeInteger integer with "minimum":0 and "exclusiveMinimum":false
unsignedLong integer from 0 to 18446744073709551615
unsignedInt integer from 0 to 4294967295
unsignedShort integer from 0 to 65535
unsignedByte integer from 0 to 255
positiveInteger integer with "minimum":0 and "exclusiveMinimum":true
double number
anyURI string with "format":"uri"
QName object with properties namespaceURI, localPart, prefix
NOTATION QName
duration object with properties sign, years, months, days, hours, minutes, seconds
dateTime object with properties year, month, day, hour, minute, second, fractionalSecond, timezone
date object with properties year, month, day, timezone
time object with properties hour, minute, second, fractionalSecond, timezone
gYearMonth object with properties year, month, timezone
gYear object with properties year, timezone
gMonthDay object with properties month, day, timezone
gDay object with properties day, timezone
gMonth object with properties month, timezone
Clone this wiki locally