diff --git a/test-suite/schema-generation/token/datatype-token-test-FAIL.xml b/test-suite/schema-generation/token/datatype-token-test-FAIL.xml
new file mode 100644
index 000000000..dbfbf9917
--- /dev/null
+++ b/test-suite/schema-generation/token/datatype-token-test-FAIL.xml
@@ -0,0 +1,6 @@
+
+
+
+ 7b5d9713-4488-4d71-8e77-85b0b185d71a
+ :xyz
+
\ No newline at end of file
diff --git a/test-suite/schema-generation/token/datatypes-token_metaschema.xml b/test-suite/schema-generation/token/datatypes-token_metaschema.xml
new file mode 100644
index 000000000..4e373a222
--- /dev/null
+++ b/test-suite/schema-generation/token/datatypes-token_metaschema.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+ Metaschema Unit Test: Token Datatype
+ 1.0-milestone2
+ metaschema-datatypes-token
+ http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri
+ http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri
+
+
+ parent
+ parent assembly
+ parent
+
+ A metaschema 'token', a string without spaces suitable for use as a key value)
+ Corresponds to XML NCName (no-colon name).
+
+
+
+
+
+
+
+
+
+ A metaschema 'token', a string without spaces for use as a key value
+ Corresponds to XML NCName (no-colon name).
+
+
+
diff --git a/test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json b/test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json
new file mode 100644
index 000000000..37aefbf44
--- /dev/null
+++ b/test-suite/schema-generation/token/datatypes-token_metaschema_JSON-SCHEMA.json
@@ -0,0 +1,42 @@
+
+ { "$schema" : "http://json-schema.org/draft-07/schema#",
+ "$id" : "http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-uri/1.0-milestone2/metaschema-datatypes-token-schema.json",
+ "$comment" : "Metaschema Unit Test: Token Datatype: JSON Schema",
+ "type" : "object",
+ "definitions" :
+ { "metaschema-datatypes-token-metaschema-datatypes-token:parent" :
+ { "title" : "parent",
+ "description" : "parent assembly",
+ "$id" : "#assembly_metaschema-datatypes-token_parent",
+ "type" : "object",
+ "properties" :
+ { "token-flag" :
+ { "title" : "A metaschema 'token', a string without spaces suitable for use as a key value)",
+ "description" : "Corresponds to XML NCName (no-colon name).",
+ "type" : "string",
+ "pattern" : "^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" },
+ "token-fields" :
+ { "anyOf" :
+ [
+ { "$ref" : "#field_metaschema-datatypes-token_token-field" },
+
+ { "type" : "array",
+ "minItems" : 1,
+ "items" :
+ { "$ref" : "#field_metaschema-datatypes-token_token-field" } } ] } },
+ "required" :
+ [ "token-flag" ],
+ "additionalProperties" : false },
+ "metaschema-datatypes-token-metaschema-datatypes-token:token-field" :
+ { "title" : "A metaschema 'token', a string without spaces for use as a key value",
+ "description" : "Corresponds to XML NCName (no-colon name).",
+ "$id" : "#field_metaschema-datatypes-token_token-field",
+ "type" : "string",
+ "pattern" : "^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" } },
+ "properties" :
+ { "parent" :
+ { "$ref" : "#assembly_metaschema-datatypes-token_parent" } },
+ "required" :
+ [ "parent" ],
+ "additionalProperties" : false,
+ "maxProperties" : 1 }
\ No newline at end of file
diff --git a/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd b/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd
new file mode 100644
index 000000000..5a555deb9
--- /dev/null
+++ b/test-suite/schema-generation/token/datatypes-token_metaschema_XML-SCHEMA.xsd
@@ -0,0 +1,72 @@
+
+
+
+
+ Metaschema Unit Test: Token Datatype
+ 1.0-milestone2
+ metaschema-datatypes-token
+ parent
+
+
+
+
+
+
+ parent
+ parent assembly
+
+
+ parent: parent assembly
+
+
+
+
+
+
+
+ A metaschema 'token', a string without spaces suitable for use as a key value)
+ Corresponds to XML NCName (no-colon name).
+
+
+ A metaschema 'token', a string without spaces suitable for use as a key value): Corresponds to XML NCName (no-colon name).
+
+
+
+
+
+
+ A metaschema 'token', a string without spaces for use as a key value
+ Corresponds to XML NCName (no-colon name).
+
+
+ A metaschema 'token', a string without spaces for use as a key value: Corresponds to XML NCName (no-colon name).
+
+
+
+
+
+ A string token following the rules of XML "no colon" names, with no whitespace. (XML names are single alphabetic characters
+ followed by alphanumeric characters, periods, underscores or dashes.)
+
+
+
+
+
+ A single token may not contain whitespace.
+
+
+
+
+
diff --git a/test-suite/schema-generation/token/datatypes-token_test_invalid_FAIL.json b/test-suite/schema-generation/token/datatypes-token_test_invalid_FAIL.json
new file mode 100644
index 000000000..90ee64948
--- /dev/null
+++ b/test-suite/schema-generation/token/datatypes-token_test_invalid_FAIL.json
@@ -0,0 +1,5 @@
+{
+ "parent": {
+ "token-flag": ":::"
+ }
+}
\ No newline at end of file
diff --git a/test-suite/schema-generation/token/datatypes-token_test_valid_PASS.json b/test-suite/schema-generation/token/datatypes-token_test_valid_PASS.json
new file mode 100644
index 000000000..6f733818b
--- /dev/null
+++ b/test-suite/schema-generation/token/datatypes-token_test_valid_PASS.json
@@ -0,0 +1,11 @@
+{
+ "parent": {
+ "token-flag": "F22",
+ "token-fields": [
+ "Af70e7c83",
+ "B4b1344c3",
+ "C398f9ba5",
+ "Ω"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/toolchains/xslt-M4/make-metaschema-xsd.xpl b/toolchains/xslt-M4/make-metaschema-xsd.xpl
index a256246f6..20ef8aaad 100644
--- a/toolchains/xslt-M4/make-metaschema-xsd.xpl
+++ b/toolchains/xslt-M4/make-metaschema-xsd.xpl
@@ -31,7 +31,7 @@
-
+
diff --git a/toolchains/xslt-M4/nist-metaschema-MAKE-JSON-SCHEMA-debug.xsl b/toolchains/xslt-M4/nist-metaschema-MAKE-JSON-SCHEMA-debug.xsl
new file mode 100644
index 000000000..64b5715bc
--- /dev/null
+++ b/toolchains/xslt-M4/nist-metaschema-MAKE-JSON-SCHEMA-debug.xsl
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ off
+
+
+
+
+
+
+
+
+ compose/metaschema-collect.xsl
+ compose/metaschema-build-refs.xsl
+ compose/metaschema-trim-extra-modules.xsl
+ compose/metaschema-prune-unused-definitions.xsl
+ compose/metaschema-resolve-use-names.xsl
+ compose/metaschema-resolve-sibling-names.xsl
+ compose/metaschema-digest.xsl
+ compose/annotate-composition.xsl
+
+ schema-gen/make-json-schema-metamap.xsl
+
+
+
+
\ No newline at end of file
diff --git a/toolchains/xslt-M4/nist-metaschema-MAKE-XSD.xsl b/toolchains/xslt-M4/nist-metaschema-MAKE-XSD.xsl
index 3adb6e3fe..6a8da2c61 100644
--- a/toolchains/xslt-M4/nist-metaschema-MAKE-XSD.xsl
+++ b/toolchains/xslt-M4/nist-metaschema-MAKE-XSD.xsl
@@ -11,7 +11,7 @@
-
+
\ No newline at end of file
diff --git a/toolchains/xslt-M4/schema-gen/datatypes-query.xsl b/toolchains/xslt-M4/schema-gen/datatypes-query.xsl
new file mode 100644
index 000000000..bd74be25f
--- /dev/null
+++ b/toolchains/xslt-M4/schema-gen/datatypes-query.xsl
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Copies of simpleType declarations for querying by
+ routines that need to know about XSD simple types we may use. Any simpleType
+ we support should be listed here for propagation in tools e.g. Metaschema Schematron.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { @key }: {.}
+
+
+
\ No newline at end of file
diff --git a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl
index a6f49ff02..217987c13 100644
--- a/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl
+++ b/toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl
@@ -620,7 +620,15 @@
-
+
+
+
+
+
+
+
-->
-
-
-