diff --git a/test-suite/broken/allowed-values-confusion-metaschema.xml b/test-suite/broken/allowed-values-confusion-metaschema.xml deleted file mode 100644 index 131cad420..000000000 --- a/test-suite/broken/allowed-values-confusion-metaschema.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - http://csrc.nist.gov/metaschema/ns/test - - -

Bug: test produced for constraint 'chronology-check' at the end, erroneously applies to elements defined with local definitions with the same name.

-

Local definitions must provide implicit overrides of rules defined in global definitions.

-
- - - - Item - A member of a sequence - - - - - - a - b - c - - - - - - - - - - - - Number sequences - Several number sequences, in sequence - SEQUENCES - - - - - - - - - Sequence - A series of items - - - - - - - - - - - one - two - three - - - - - - a umlaut - o umlaut - u umlaut - - - - - pink - orange - purple - - - - - - Subsequence - More sequences - - - - - Subsequence item - An item in a sequence in a sequence - - - - red - blue - green - - - - - - - - - - - Item type - Characterizes the type of item - -
\ No newline at end of file diff --git a/test-suite/broken/allowed-values-confusion-metaschema_JSON-SCHEMA.json b/test-suite/broken/allowed-values-confusion-metaschema_JSON-SCHEMA.json deleted file mode 100644 index 972357c20..000000000 --- a/test-suite/broken/allowed-values-confusion-metaschema_JSON-SCHEMA.json +++ /dev/null @@ -1,108 +0,0 @@ - - { "$schema" : "http://json-schema.org/draft-07/schema#", - "$id" : "http://csrc.nist.gov/metaschema/ns/test-schema.json", - "$comment" : "Test Metaschema: JSON Schema", - "type" : "object", - "definitions" : - { "item" : - { "title" : "Item", - "description" : "A member of a sequence", - "type" : "object", - "properties" : - { "type" : - { "title" : "Item type", - "description" : "Characterizes the type of item", - "type" : "string" }, - "id" : - { "type" : "string" }, - "STRVALUE" : - { "type" : "string" } }, - "required" : - [ "STRVALUE" ], - "additionalProperties" : false, - "enum" : - [ "A", - "B", - "C" ] }, - "SEQUENCES" : - { "title" : "Number sequences", - "description" : "Several number sequences, in sequence", - "type" : "object", - "properties" : - { "sequences" : - { "anyOf" : - [ - { "$ref" : "#/definitions/sequence" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/sequence" } } ] } }, - "additionalProperties" : false }, - "sequence" : - { "title" : "Sequence", - "description" : "A series of items", - "type" : "object", - "properties" : - { "items" : - { "anyOf" : - [ - { "$ref" : "#/definitions/item" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/item" } } ] }, - "subsequences" : - { "anyOf" : - [ - { "$ref" : "#/definitions/subsequence" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/subsequence" } } ] } }, - "additionalProperties" : false }, - "subsequence" : - { "title" : "Subsequence", - "description" : "More sequences", - "type" : "object", - "properties" : - { "items" : - { "anyOf" : - [ - { "item" : - { "title" : "Subsequence item", - "description" : "An item in a sequence in a sequence", - "type" : "string", - "enum" : - [ "red", - "blue", - "green" ] } }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "item" : - { "title" : "Subsequence item", - "description" : "An item in a sequence in a sequence", - "type" : "string", - "enum" : - [ "red", - "blue", - "green" ] } } } ] }, - "subsequences" : - { "anyOf" : - [ - { "$ref" : "#/definitions/subsequence" }, - - { "type" : "array", - "minItems" : 1, - "items" : - { "$ref" : "#/definitions/subsequence" } } ] } }, - "additionalProperties" : false } }, - "properties" : - { "SEQUENCES" : - { "$ref" : "#/definitions/SEQUENCES" } }, - "required" : - [ "SEQUENCES" ] } \ No newline at end of file diff --git a/test-suite/broken/allowed-values-confusion-metaschema_METATRON.sch b/test-suite/broken/allowed-values-confusion-metaschema_METATRON.sch deleted file mode 100644 index 67d73d521..000000000 --- a/test-suite/broken/allowed-values-confusion-metaschema_METATRON.sch +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - Where true(), is expected to match regular expression '^[\dabcdef]+$' - - - - - Where true(), is expected to be (one of) '1', '2', '3', not '' - [[See id#T1]] - - - - Where true(), is expected to be (one of) 'Ä', 'Ö', 'Ü', not '' - [[See id#T2]] - - - - Where true(), is expected to be (one of) 'pink', 'orange', 'purple', not '' - [[See id#T3]] - - - - Where true(), is expected to be (one of) 'red', 'blue', 'green', not '' - [[See id#L1]] - - - - Where true(), is expected to be (one of) 'A', 'B', 'C', not '' - [[See id#G1]] - - - - Where true(), is expected to be unique. - - - - diff --git a/test-suite/broken/allowed-values-confusion-metaschema_XML-SCHEMA.xsd b/test-suite/broken/allowed-values-confusion-metaschema_XML-SCHEMA.xsd deleted file mode 100644 index 3305d0ca3..000000000 --- a/test-suite/broken/allowed-values-confusion-metaschema_XML-SCHEMA.xsd +++ /dev/null @@ -1,164 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - -

Bug: test produced for constraint 'chronology-check' at the end, erroneously applies to elements defined with local definitions with the same name.

-

Local definitions must provide implicit overrides of rules defined in global definitions.

-
- SEQUENCES -
-
- - - - Item - A member of a sequence - - - Item: A member of a sequence - - - - - - - Item type - Characterizes the type of item - - - Item type: Characterizes the type of item - - - - - - - - - - - -

a

-
-
-
- - - -

b

-
-
-
- - - -

c

-
-
-
-
-
- - - - - Number sequences - Several number sequences, in sequence - - - Number sequences: Several number sequences, in sequence - - - - - - - - - Sequence - A series of items - - - Sequence: A series of items - - - - - - - - - - Subsequence - More sequences - - - Subsequence: More sequences - - - - - - - Subsequence item - An item in a sequence in a sequence - - - Subsequence item: An item in a sequence in a sequence - - - - - - - - - - -

red

-
-
-
- - - -

blue

-
-
-
- - - -

green

-
-
-
-
-
-
- -
-
-
diff --git a/test-suite/broken/allowed-values-confusion-metaschema_declaration-map.xml b/test-suite/broken/allowed-values-confusion-metaschema_declaration-map.xml deleted file mode 100644 index 85ca429ab..000000000 --- a/test-suite/broken/allowed-values-confusion-metaschema_declaration-map.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - a - b - c - - - - - - - - - - - - - - - - - red - blue - green - - - - - - - - - - - - one - two - three - - - a umlaut - o umlaut - u umlaut - - - - - - diff --git a/test-suite/broken/allowed-values-test-metaschema.xml b/test-suite/broken/allowed-values-test-metaschema.xml deleted file mode 100644 index b9c98cfa6..000000000 --- a/test-suite/broken/allowed-values-test-metaschema.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - http://csrc.nist.gov/metaschema/ns/test - - - Item - A member of a sequence - - - - - - a - b - c - - - - a - b - - - - - - - Sequences - Several sequences, in sequence - SEQUENCES - - - - - - - - - Sequence - A series of items - - - - - - - - - - - one - two - three - - - - - - a umlaut - o umlaut - u umlaut - - - - - pink - orange - purple - - - - - - Subsequence - More sequences - - - - - Subsequence item - An item in a sequence in a sequence - - - - red - blue - green - - - - - - - - - - - Item type - Characterizes the type of item - - \ No newline at end of file diff --git a/test-suite/broken/allowed-values-test-metaschema_METATRON.sch b/test-suite/broken/allowed-values-test-metaschema_METATRON.sch deleted file mode 100644 index c3395efe8..000000000 --- a/test-suite/broken/allowed-values-test-metaschema_METATRON.sch +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - This is expected to be (one of) 'A', 'B', 'C', not '' - [[See id#G1]] - - This is expected to be (one of) 'A', 'B', not '' - [[See id#G1]] - - This is expected to be (one of) '1', '2', '3', not '' - [[See id#T1]] - - This is expected to be (one of) 'Ä', 'Ö', 'Ü', not '' - [[See id#T2]] - - This is expected to be (one of) 'pink', 'orange', 'purple', not '' - [[See id#T3]] - - This is expected to be (one of) 'red', 'blue', 'green', not '' - [[See id#L1]] - - - diff --git a/test-suite/broken/implicit-local-constrain-override-metaschema.xml b/test-suite/broken/implicit-local-constrain-override-metaschema.xml deleted file mode 100644 index 2f593cc0f..000000000 --- a/test-suite/broken/implicit-local-constrain-override-metaschema.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - http://csrc.nist.gov/metaschema/ns/test - - -

Bug: test produced for constraint 'chronology-check' at the end, erroneously applies to elements defined with local definitions with the same name.

-

Local definitions must provide implicit overrides of rules defined in global definitions.

-
- - - Biographical info - Gives basic facts or colorful detail. - BIO - - - Facts - Structured data - - - - Residency - A range of values in time-space - - - - Place of residence - Name of locale, site or habitation - - - Dates - Start to end - - Start - When initiated - - End - When concluded or abandoned - - - - - - - - - Colorful details - Unstructured data - - - Dates - This time, a string, so "Lincoln's Birthday" is a date. - - - - - - - - Dates - As a range (birth-death) or floruit - range - - - - Birth date - If only the year is known use June 30. - - - - Death date - If only the year is known use July 1. - - - Floruit date - Do not use along with both birth and death - - - - - - - - -
\ No newline at end of file diff --git a/test-suite/broken/implicit-local-constrain-override-metaschema_METATRON.sch b/test-suite/broken/implicit-local-constrain-override-metaschema_METATRON.sch deleted file mode 100644 index 56a1de129..000000000 --- a/test-suite/broken/implicit-local-constrain-override-metaschema_METATRON.sch +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - fails to pass evaluation of 'xs:date(@birth) < xs:date(@death)' - [[See id#chronology-check]] - - - - - - Where exists(.), is expected to take the form of datatype date' - - - - - - - - - - string - string - NCName - { $nominal-type } - - - - {$value} - - - - - - - diff --git a/test-suite/broken/implicit-local-constrain-override-metaschema_XML-SCHEMA.xsd b/test-suite/broken/implicit-local-constrain-override-metaschema_XML-SCHEMA.xsd deleted file mode 100644 index 2866df6a4..000000000 --- a/test-suite/broken/implicit-local-constrain-override-metaschema_XML-SCHEMA.xsd +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - -

Local definitions must provide implicit overrides of rules defined in global definitions.

-
- BIO -
-
- - - - - Biographical info - Gives basic facts or colorful detail. - - - Biographical info: Gives basic facts or colorful detail. - - - - - - - Facts - Structured data - - - Facts: Structured data - - - - - - - - Residency - A range of values in time-space - - - Residency: A range of values in time-space - - - - - - - Place of residence - Name of locale, site or habitation - - - Place of residence: Name of locale, site or habitation - - - - - - - - - - - - Start - When initiated - - - Start: When initiated - - - - - - End - When concluded or abandoned - - - End: When concluded or abandoned - - - - - - - - - - - - - - - Colorful details - Unstructured data - - - Colorful details: Unstructured data - - - - - - - Dates - This time, a string, so "Lincoln's Birthday" is a date. - - - Dates: This time, a string, so "Lincoln's Birthday" is a date. - - - - - - - - - - - - - - - - Birth date - If only the year is known use June 30. - - - Birth date: If only the year is known use June 30. - - - - - - Death date - If only the year is known use July 1. - - - Death date: If only the year is known use July 1. - - - - - - Floruit date - Do not use along with both birth and death - - - Floruit date: Do not use along with both birth and death - - - -
diff --git a/test-suite/broken/use-name-questions-metaschema.xml b/test-suite/broken/use-name-questions-metaschema.xml deleted file mode 100644 index 0105a1650..000000000 --- a/test-suite/broken/use-name-questions-metaschema.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Test Metaschema - 1.0 - anthology - http://csrc.nist.gov/metaschema/ns/test - - - ROOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ITEM - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test-suite/docs-models/models_metaschema.xml b/test-suite/docs-models/models_metaschema.xml new file mode 100644 index 000000000..58169d158 --- /dev/null +++ b/test-suite/docs-models/models_metaschema.xml @@ -0,0 +1,293 @@ + + + + + NIST Metaschema Everything + 1.0 + test-model + http://csrc.nist.gov/metaschema/ns/everything + + +

A mini metaschema produced for documentation testing purposes.

+

This metaschema exercises modeling with a mix of global, modular (local) and inline + definitions. In particular, root-name and use-name should be deployed.

+
+ + + ID + flag id + + + + Simple Flag + some string + + + + Integer Flag + an integer + + + + + Everything (container) + assembly everything is the root (containing element or top-level object) of this schema. + EVERYTHING + + + + + overloaded1 + + + overloaded2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alias + + + + + + + + + + + + + + + + + + + + Overloaded field + A field called several times by different names. + + + + + + Solitary field + field field-1only + + + + + + Lexically constrainted field + field field-base64 + + + + Boolean typed field + field field-boolean + + + + Groupable field + simple field, groupable + + + + + + Flagged groupable field + field field-groupable + + Date flag + A flag for a date + + + Decimal flag + A flag with a decimal value + + + + + Wrappable field + field field-wrappable + + + + Keyed field + field field-by-key + + + + + + Named-value field + field field-named-value + CUSTOM-VALUE-KEY + + + + + Dynamic value key field + field field-dynamic-value-key + + + + COLOR + flag color + + + + + Markup line field + field markup-line + + + + Wrapped prose field + field wrapped-prose + + + + Unwrapped prose + field loose-prose + + + + Empty assembly + assembly assembly-empty + + + + + Groupable empty assembly + assembly assembly-empty-grouped + + + + + Solitary assembly + assembly assembly-1only + ASSEMBLY-1ONLY + + + + + + + + Assembly with inline definitions + Inline definitions have their own metadata too. + + + + + alias + + + Inline assembly + Assembly whose definition is inline + + + An inline assembly named 'alias' + Assembly whose definition is inline, but whose name is 'alias' + + + + + + Aliased assembly - outer + first aliased assembly (has a name conflict) + alias + + + + + alias + + + + + + Aliased assembly - inner + second aliased assembly (has a name conflict) appears only in the context of its parent of the same name. + + + + + + + + Groupable assembly. + assembly assembly-groupable + + + + + + + + + + + + Wrappable assembly + assembly assembly-wrappable + + + + + + + + + + + + + Keyed assembly + assembly assembly-by-key + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl b/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl index 7d209e1ce..24b450419 100644 --- a/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl +++ b/toolchains/xslt-M4/document/json/json-docs-hugo-uswds.xsl @@ -249,7 +249,9 @@ - + + - { if (not(@min-occurs != '0')) then 'optional' else 'required' } + [{ if (not(@min-occurs != '0')) then 'optional' else 'required' }] @@ -659,7 +661,9 @@ + mode="occurrence-code"> + + { $definition/formal-name }{' '[empty($definition/formal-name)] } diff --git a/toolchains/xslt-M4/document/json/object-map-html.xsl b/toolchains/xslt-M4/document/json/object-map-html.xsl index 989e49453..f95540e39 100644 --- a/toolchains/xslt-M4/document/json/object-map-html.xsl +++ b/toolchains/xslt-M4/document/json/object-map-html.xsl @@ -11,7 +11,7 @@ - ../../datatypes + ../../../datatypes @@ -62,14 +62,14 @@ details:not([open]) .show-closed { display: inline } - -
-

- - +

+ : @@ -77,7 +77,7 @@ details:not([open]) .show-closed { display: inline } , - +

@@ -93,8 +93,11 @@ details:not([open]) .show-closed { display: inline } open - - + + + : @@ -104,18 +107,12 @@ details:not([open]) .show-closed { display: inline } … } , - + - +
-

@@ -139,16 +136,9 @@ details:not([open]) .show-closed { display: inline } { -

-

@@ -164,7 +154,10 @@ details:not([open]) .show-closed { display: inline }

- + @@ -174,13 +167,10 @@ details:not([open]) .show-closed { display: inline } - -
- +

@@ -188,7 +178,7 @@ details:not([open]) .show-closed { display: inline } ,

-
+
@@ -276,14 +266,11 @@ details:not([open]) .show-closed { display: inline } - { @as-type } + { @as-type } - - +
diff --git a/toolchains/xslt-M4/document/json/object-tree.xsl b/toolchains/xslt-M4/document/json/object-tree.xsl index 8a847b32a..77f6c1b03 100644 --- a/toolchains/xslt-M4/document/json/object-tree.xsl +++ b/toolchains/xslt-M4/document/json/object-tree.xsl @@ -42,6 +42,17 @@
+ + + + + + + + + + + diff --git a/toolchains/xslt-M4/document/xml/element-map-html.xsl b/toolchains/xslt-M4/document/xml/element-map-html.xsl index bbec28dcb..a64d68dda 100644 --- a/toolchains/xslt-M4/document/xml/element-map-html.xsl +++ b/toolchains/xslt-M4/document/xml/element-map-html.xsl @@ -5,7 +5,7 @@ xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0" exclude-result-prefixes="#all"> - + @@ -79,14 +79,11 @@ div.OM-map p { margin: 0ex } ../../../datatypes - + { $type } -
open @@ -108,9 +105,6 @@ div.OM-map p { margin: 0ex } -

@@ -122,15 +116,16 @@ div.OM-map p { margin: 0ex } + < - / + / > - + @@ -146,51 +141,7 @@ div.OM-map p { margin: 0ex } - - + @@ -270,14 +221,18 @@ div.OM-map p { margin: 0ex } - +

+

<p> or other elements defined as

+ +
+ @@ -290,7 +245,14 @@ div.OM-map p { margin: 0ex } + + (recursive: model like parent { @gi }) + + + (recursive: model like ancestor { @gi }) + + @@ -311,5 +273,9 @@ div.OM-map p { margin: 0ex } ] + + + [0 to ∞] + diff --git a/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl b/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl index 2ca88b98c..d930a6bf9 100644 --- a/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl +++ b/toolchains/xslt-M4/document/xml/xml-docs-hugo-uswds.xsl @@ -761,10 +761,10 @@

-

The value may be locally defined, or { 'one of '[count($enums) gt 1] }the following ({count($enums)}):

+

The value may be locally defined, or { 'one of '[count($enums) gt 1] }the following:

-

The value must be one of the following ({count(enum)}):

+

The value must be one of the following ({count(enum)}):

    @@ -865,17 +865,13 @@ - - - + + +
    - - +
    @@ -883,29 +879,32 @@ - - - - - - + + + + + + - + - - + @@ -1101,11 +1100,11 @@ - - + + +