diff --git a/issue39-refactor.xpr b/issue39-refactor.xpr new file mode 100644 index 000000000..e169bb73f --- /dev/null +++ b/issue39-refactor.xpr @@ -0,0 +1,4842 @@ + + + + + + + + + document.type.use.grammar.cache + false + + + document.types + + + + key.editor.document.type.association.option.pane + true + + + key.fonts.option.pane + true + + + scenario.associations + + + + toolchains/xslt-proto-v04/testing/models-testdata.xml + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/models_metaschema.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/converter-gen/produce-xml-converter.xsl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/test-xml-conversions.xpl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/tiny_definition-map.xml + + + + Test XML->JSON conversion on tiny.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/tiny_metaschema.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/tiny.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/schema_gen/make-metaschema-xsd.xsl + + + + Apply (this) XSLT to composed catalog metaschema (and open) + + + + + XML + + + + + 2 + + + + + + toolchains/xslt-proto-v04/make-metaschema-xml-to-supermodel-xslt.xpl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/make-metaschema-xml-to-json-xslt.xpl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + test-suite/broken/allowed-values-test-metaschema.xml + + + + Produce Metatron for (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + test-suite/broken/allowed-values-confusion-metaschema.xml + + + + Produce Metatron for (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/make-metaschema-json-schema.xpl + + + + Apply (this) XProc to OSCAL CATALOG metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/converter-gen/supermodel-to-json.xsl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/schema_gen/json-schema-metamap.xsl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/testing/test-metaschema-conversions.xpl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-examples/everything-metaschema/test-metaschema-conversions.xpl + + + + Test XML->JSON conversion on models-testdata.xml + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-examples/everything-metaschema/models_metaschema.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/metaschema-compose.xpl + + + + Apply (this) XProc to OSCAL CATALOG metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/converter-gen/supermodel-json-serializer.xsl + + + + Apply (this) XSLT to supermodel example + + + + + XML + + + + + 2 + + + + + + toolchains/xslt-proto-v04/converter-gen/supermodel-xml-serializer.xsl + + + + Apply (this) XSLT to supermodel example + + + + + XML + + + + + 2 + + + + + + test-suite/broken/implicit-local-constrain-override-metaschema.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/make-metaschema-metatron.xpl + + + + Update Everything Metatron + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/make-metaschema-abstract-map.xpl + + + + Apply (this) XProc to OSCAL CATALOG metaschema + + + + + XPROC + + + + + 2 + + + + + + test-suite/broken/allowed-values-confusion-metaschema_declaration-map.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-examples/anthology/anthology_metaschema.xml + + + + Produce MAPS for this metaschema + + + + + XPROC + + + + + 2 + + + + + + test-suite/broken/implicit-local-constrain-override.xml + + + + Produce XSD for (this) metaschema (v04 XProc) + Produce Metatron for (this) metaschema (v04 XProc) + + + + + XPROC + XPROC + + + + + 2 + 2 + + + + + + test-suite/worked-example/everything_metaschema.xml + + + + Update Everything Metatron + Update Everything Metaschema (composed metaschema + XSD) + + + + + XPROC + XPROC + + + + + 2 + 2 + + + + + + test-suite/worked-example/exercise-everything.xml + + + + Update Everything Metaschema (composed metaschema + XSD) + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-example/kitchen-drawer.xml + + + + Update Everything Metaschema (composed metaschema + XSD) + + + + + XPROC + + + + + 2 + + + + + + test-suite/oscal/oscal_catalog_metaschema.xml + + + + Compose (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/compose/make-definition-map.xsl + + + + Apply (this) XSLT to composed catalog metaschema (and open) + + + + + XML + + + + + 2 + + + + + + test-suite/worked-example/everything_metaschema.xsd + + + + Produce JSON Schema for (this) metaschema (v04 XProc) + Produce XSD for (this) metaschema (v04 XProc) + + + + + XPROC + XPROC + + + + + 2 + 2 + + + + + + toolchains/xslt-proto-v04/compose/test-me.xsl + + + + Apply (this) XSLT to (base) Everything metaschema (and open) + + + + + XML + + + + + 2 + + + + + + toolchains/xslt-proto-v04/compose/build-definition-map.xsl + + + + Apply (this) XSLT to (base) Everything metaschema (and open) + + + + + XML + + + + + 2 + + + + + + toolchains/xslt-proto-v04/compose/build-model-map.xsl + + + + Apply (this) XSLT to (base) Everything metaschema (and open) + + + + + XML + + + + + 2 + + + + + + toolchains/xslt-proto-v04/document/json/json-docs-hugo-uswds.xsl + + + + Produce oscal catalog metaschema DOCS + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/document/metaschema-common-html.xsl + + + + Produce oscal catalog metaschema DOCS + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/document/xml/xml-docs-hugo-uswds.xsl + + + + Produce oscal catalog metaschema DOCS + + + + + XPROC + + + + + 2 + + + + + + toolchains/xslt-proto-v04/compose/metaschema-reduce2.xsl + + + + Compose metaschema - kitchen drawer example (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-example/resource-registry_metaschema.xml + + + + Compose (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-example/everything_metaschema-daw.xml + + + + Compose (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-example/registry-working.xml + + + + Compose (this) metaschema (v04 XProc) + + + + + XPROC + + + + + 2 + + + + + + test-suite/worked-example/resource-registry_metaschema_COMPOSED.xml + + + + COMPOSE (this) metaschema - v04 XSLT3 + + + + + XSL + + + + + 2 + + + + + + test-suite/worked-example/xml-catalog_metaschema.xml + + + + COMPOSE (this) metaschema - v04 XSLT3 + + + + + XSL + + + + + 2 + + + + + + + scenarios + + + + + + + COMPOSE (this) metaschema - v04 XSLT3 + + + + + + + + + pdf + + + Apache FOP + + + + + + ${pdu}/toolchains/xslt-proto-v04/nist-metaschema-COMPOSE.xsl + + + ${currentFileURL} + + + false + + + false + + + XSL + + + true + + + false + + + ${cfn}_COMPOSED.xml + + + false + + + + + + true + + + false + + + false + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Apply (this) XSLT to (base) Everything metaschema + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + false + + + false + + + XML + + + true + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Apply (this) XSLT to (base) Everything metaschema (and open) + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + false + + + false + + + XML + + + true + + + false + + + ${cfn}-everything-result.xml + + + false + + + + + + true + + + false + + + false + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Apply (this) XSLT to composed catalog metaschema (and open) + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/test-suite/oscal/oscal_catalog_metaschema-COMPOSED.xml + + + false + + + false + + + XML + + + true + + + false + + + ${cfn}-catalog-result.xml + + + false + + + + + + true + + + false + + + false + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Apply (this) XSLT to supermodel example + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/test-suite/worked-examples/everything-metaschema/models-testdata-supermodel.xml + + + false + + + false + + + XML + + + true + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Apply this XSLT to (test) Models definition map + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/test-suite/worked-examples/everything-metaschema/models-definition-map.xml + + + false + + + false + + + XML + + + true + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Refresh Everything XSD + + + + + + + + + pdf + + + Apache FOP + + + + + + ${pdu}/toolchains/xslt-proto-v04/schema_gen/make-metaschema-xsd.xsl + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + false + + + false + + + XML + + + true + + + false + + + ${pd}/test-suite/worked-example/everything.xsd + + + false + + + + + + false + + + false + + + false + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + source + + + + ${pdu}/test-suite/worked-examples/everything-metaschema/models_metaschema.xml + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + E.definition-map + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Apply (this) XProc to Models (test) metaschema + + + + + + + + + + + + + + + + + + ${currentFileURL} + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/oscal/oscal_catalog_metaschema.xml + + + + + + + + + + _0_main-module + + + + + + true + + + + + _1_collected + + + + + + true + + + + + _2_reduced + + + + + + true + + + + + _3_digested + + + + + + true + + + + + _4_XSD + + + + + + true + + + + + final + + + + + + true + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c1.XSD-pre + + + + + + true + + + + + c2.XSD + + + + + + true + + + + + f.final + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.xml-model-map + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Apply (this) XProc to OSCAL CATALOG metaschema + + + + + + + + + + + + + + + + + + ${currentFileURL} + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + _0_input + + + + + + true + + + + + final + + + + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Compose (this) metaschema (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/metaschema-compose.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + + + + + + + + _0_input + + + + + + true + + + + + final + + + + + + true + + + + + _0_main-module + + + + + + true + + + + + _1_collected + + + + + + true + + + + + _2_reduced1 + + + + + + true + + + + + _3_reduced2 + + + + + + true + + + + + _4_digested + + + + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Compose metaschema - kitchen drawer example (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/metaschema-compose.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.json-schema-xml + + + + + + true + + + + + f.json-schema + + + ${cfn}_JSON-SCHEMA.json + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Produce JSON Schema for (this) metaschema (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-json-schema.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + X1.xml-element-tree + + + + + + true + + + + + J1.json-object-tree + + + + + + true + + + + + e.models-only + + + + + + true + + + + + F.declaration-map + + + ${cfn}_declaration-map.xml + + + true + + + + + X2.xml-model-html + + + + + + true + + + + + J2.json-model-html + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Produce MAPS for this metaschema + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-model-maps.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.metatron + + + + + + true + + + + + f.final + + + ${cfn}_METATRON.sch + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Produce Metatron for (this) metaschema (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-metatron.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + X1.xml-element-tree + + + + + + true + + + + + J1.json-object-tree + + + + + + true + + + + + e.models-only + + + + + + true + + + + + F.declaration-map + + + ${cfn}_declaration-map.xml + + + true + + + + + X2.xml-model-html + + + + + + true + + + + + J2.json-model-html + + + + + + true + + + + + E.definition-map + + + + + + true + + + + + A.definition-map + + + + + + true + + + + + C.xml-converter + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Produce XML-supermodel CONVERTER for this metaschema + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-xml-to-supermodel-xslt.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c0.pre-XSD + + + + + + true + + + + + c1.XSD + + + + + + true + + + + + f.final + + + ${cfn}_XML-SCHEMA.xsd + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Produce XSD for (this) metaschema (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-xsd.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/oscal/oscal_catalog_metaschema.xml + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + X.xml-docs + + + ${pdu}/test-suite/oscal/catalog-xml-docs.html + + + true + + + + + J.json-docs + + + ${pdu}/test-suite/oscal/catalog-json-docs.html + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Produce oscal catalog metaschema DOCS + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-docs.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/oscal/oscal_catalog_metaschema.xml + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + X1.xml-element-tree + + + + + + true + + + + + X2.xml-model-html + + + ${pdu}/test-suite/oscal/catalog-xml-map.html + + + true + + + + + J1.json-object-tree + + + + + + true + + + + + J2.json-model-html + + + ${pdu}/test-suite/oscal/catalog-json-map.html + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Produce oscal catalog metaschema MAPS + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-model-maps.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${currentFileURL} + + + + + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Run experimental pipeline for (this) metaschema (v04 XProc) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-sandbox.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + metaschema-source + + + + ${pdu}/toolchains/xslt-proto-v04/testing/models_metaschema.xml + + + + + + testdata-xml + + + + ${pdu}/toolchains/xslt-proto-v04/testing/models-testdata.xml + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + A.definition-map + + + + + + true + + + + + C.xml-converter + + + + + + true + + + + + S.testdata-supermodel + + + ${pdu}/toolchains/xslt-proto-v04/testing/testdata-supermodel.xml + + + true + + + + + _X1.testdata-xml-result + + + + + + true + + + + + S2.supermodel-with-markdown + + + + + + true + + + + + _J1.testdata-xpath-json-result + + + ${pdu}/toolchains/xslt-proto-v04/testing/testdata-json-result.xml + + + true + + + + + _J2.testdata-json-result + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Test XML->JSON conversion on models-testdata.xml + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/testing/test-xml-conversions.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + metaschema-source + + + + ${pdu}/toolchains/xslt-proto-v04/testing/tiny_metaschema.xml + + + + + + testdata-xml + + + + ${pdu}/toolchains/xslt-proto-v04/testing/tiny.xml + + + + + + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + c.abstract-model-map + + + + + + true + + + + + d.unfolded-model-map + + + + + + true + + + + + A.definition-map + + + + + + true + + + + + C.xml-converter + + + + + + true + + + + + S.testdata-supermodel + + + ${pdu}/toolchains/xslt-proto-v04/testing/testdata-supermodel.xml + + + true + + + + + _X1.testdata-xml-result + + + + + + true + + + + + S2.supermodel-with-markdown + + + + + + true + + + + + _J1.testdata-xpath-json-result + + + ${pdu}/toolchains/xslt-proto-v04/testing/testdata-json-result.xml + + + true + + + + + _J2.testdata-json-result + + + + + + true + + + + + + + + + + + + parameters + + + + + + + + * + + + + + + + + + + + + Test XML->JSON conversion on tiny.xml + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/testing/test-xml-conversions.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + + + + + + + + b.composed + + + ${pdu}/test-suite/worked-example/everything_metaschema_COMPOSED.xml + + + true + + + + + f.final + + + ${pdu}/test-suite/worked-example/everything_metaschema_XML-SCHEMA.xsd + + + true + + + + + a.echo-input + + + + + + true + + + + + c0.pre-XSD + + + + + + true + + + + + c1.XSD + + + + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Update Everything Metaschema (composed metaschema + XSD) + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-xsd.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + + + source + + + + ${pdu}/test-suite/worked-example/everything_metaschema.xml + + + + + + + + + + c.metatron + + + ${pdu}/test-suite/worked-example/everything-metaschema_METATRON.sch + + + true + + + + + a.echo-input + + + + + + true + + + + + b.composed + + + + + + true + + + + + f.final + + + + + + true + + + + + + + + + + + + * + + + + + + + + parameters + + + + + + + + + + + + Update Everything Metatron + + + + + + + + + + + + + + + + + + ${pdu}/toolchains/xslt-proto-v04/make-metaschema-metatron.xpl + + + + + + false + + + false + + + XPROC + + + false + + + false + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + false + + + + + + + + + Add-on for Calabash XProc Engine + + + + + + + + + validation.scenario.associations + + + + test-suite/worked-example/exercise-everything.xml + + + + Everything Metatron (only) + + + + + Validation_scenario + + + + + 2 + + + + + + + validation.scenarios + + + + + + + + + text/xml + + + + + ${currentFileURL} + + + + + <Default engine> + + + true + + + + + true + + + + + + + + + + + + + + 7 + + + ${pdu}/test-suite/worked-example/everything-metaschema_METATRON.sch + + + + + + + + Validation_scenario + + + Everything Metatron (only) + + + + + + + + + + text/xml + + + + + ${currentFileURL} + + + + + <Default engine> + + + true + + + + + true + + + + + + + + + + + + + + 2 + + + ${pdu}/test-suite/worked-example/everything_metaschema_XML-SCHEMA.xsd + + + + + + + + Validation_scenario + + + Everything XSD (only) + + + + + + + + + + + + \ No newline at end of file diff --git a/metaschema-testing.xpr b/metaschema-testing.xpr new file mode 100644 index 000000000..d0566df05 --- /dev/null +++ b/metaschema-testing.xpr @@ -0,0 +1,257 @@ + + + + + + + + + scenario.associations + + + + test-suite/schema-generation/collapsible/collapsible_metaschema.xml + + + + COMPOSE metaschema + + + + + XSL + + + + + + test-suite/schema-generation/flag/flag-basic_metaschema.xml + + + + COMPOSE metaschema + + + + + XSL + + + + + + toolchains/oscal-m2/lib/metaschema.xsd + + + + COMPOSE metaschema + + + + + XSL + + + + + + specification/read-schema.xsl + + + + Run on metaschema.xsd + + + + + XML + + + + + + + scenarios + + + + + + + COMPOSE metaschema + + + + + + + + + pdf + + + Apache FOP + + + + + + ${pdu}/toolchains/oscal-m2/lib/metaschema-compose.xsl + + + ${currentFileURL} + + + false + + + false + + + XSL + + + true + + + false + + + ${cfn}_COMPOSED.xml + + + ${cfn}_COMPOSED.xml + + + false + + + + + + true + + + false + + + false + + + false + + + false + + + true + + + + + + + + + Saxon-PE + + + + + + + + + + + Run on metaschema.xsd + + + + + + + + + pdf + + + Apache FOP + + + + + + ${currentFileURL} + + + ${pdu}/toolchains/oscal-m2/lib/metaschema.xsd + + + false + + + false + + + XML + + + true + + + false + + + + + + + + + false + + + + + + false + + + false + + + true + + + false + + + false + + + true + + + + + + + + + Saxon-HE + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 000000000..972357c20 --- /dev/null +++ b/test-suite/broken/allowed-values-confusion-metaschema_JSON-SCHEMA.json @@ -0,0 +1,108 @@ + + { "$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-test-metaschema.xml b/test-suite/broken/allowed-values-test-metaschema.xml new file mode 100644 index 000000000..93e9ba86b --- /dev/null +++ b/test-suite/broken/allowed-values-test-metaschema.xml @@ -0,0 +1,110 @@ + + + + + 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 new file mode 100644 index 000000000..c3395efe8 --- /dev/null +++ b/test-suite/broken/allowed-values-test-metaschema_METATRON.sch @@ -0,0 +1,39 @@ + + + + + + + + + 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/worked-examples/anthology/anthology-browse-html.xsl b/test-suite/worked-examples/anthology/anthology-browse-html.xsl new file mode 100644 index 000000000..7305937ba --- /dev/null +++ b/test-suite/worked-examples/anthology/anthology-browse-html.xsl @@ -0,0 +1,172 @@ + + + + + + + + Anthology Metaschema [display] + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ + + + + + + +
+
+ :
+ +
+
+ +

+ + : + +

+
+ + + + + + + + + [INSERT + + ] + + + +

+ + : + +

+
+
diff --git a/test-suite/worked-examples/anthology/anthology.css b/test-suite/worked-examples/anthology/anthology.css new file mode 100644 index 000000000..8fb9d7993 --- /dev/null +++ b/test-suite/worked-examples/anthology/anthology.css @@ -0,0 +1,44 @@ +* { display: block } + +p *, +li *, +pre *, +th *, +td * { display: inline } + +table { display: table } +tr { display: table-row } +th, td { display: table-cell } + + +meta { } + +piece { margin: 0.5em; padding: 0.5em; border: thin solid black } + +back { } + +creator { } + +remarks { } + +verse { } + +prose { } + +line { } + +stanza { } + +author-index { } + +author { } + +name { } + +dates { } + +publication { } + +em, i { font-style: italic } +strong, b { font-weight: bold } + diff --git a/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json b/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json new file mode 100644 index 000000000..57f2a5f72 --- /dev/null +++ b/test-suite/worked-examples/anthology/anthology_metaschema_JSON-SCHEMA.json @@ -0,0 +1,447 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/metaschema/ns/anthology-schema.json", + "$comment" : "Anthology Metaschema: JSON Schema", + "type" : "object", + "definitions" : + { "ANTHOLOGY" : + { "title" : "Anthology", + "description" : "A collection of literary excerpts", + "type" : "object", + "properties" : + { "id" : + { "title" : "Identifier", + "description" : "A distinct code", + "type" : "string" }, + "meta" : + { "$ref" : "#/definitions/meta" }, + "pieces" : + { "anyOf" : + [ + { "$ref" : "#/definitions/piece" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/piece" } } ] }, + "back" : + { "$ref" : "#/definitions/back" } }, + "required" : + [ "meta" ], + "additionalProperties" : false }, + "meta" : + { "title" : "Front matter / metadata", + "description" : "Metadata for the anthology as a ^whole, or for a single piece within it", + "type" : "object", + "properties" : + { "creators" : + { "anyOf" : + [ + { "$ref" : "#/definitions/creator" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/creator" } } ] }, + "date" : + { "$ref" : "#/definitions/date" }, + "keywords" : + { "anyOf" : + [ + { "keyword" : + { "title" : "Key word", + "description" : "A string", + "type" : "string" } }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "keyword" : + { "title" : "Key word", + "description" : "A string", + "type" : "string" } } } ] }, + "remarks" : + { "$ref" : "#/definitions/remarks" } }, + "additionalProperties" : false }, + "date" : + { "title" : "Date", + "description" : "As represented", + "type" : "object", + "properties" : + { "type" : + { "title" : "Type of date representation", + "description" : "May be given as a formatting code, e.g. 'YYYY' for year only. It is up to implementations to implement logic.", + "type" : "string" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false }, + "creator" : + { "title" : "Creator (author or editor)", + "description" : "The text contents should name the person; the optional who flag links it to the index.", + "type" : "object", + "properties" : + { "role" : + { "title" : "Role", + "description" : "Contribution of the creator", + "type" : "string", + "enum" : + [ "author", + "editor", + "translator" ] }, + "who" : + { "title" : "Person identifier", + "description" : "Relates a person to the biographical index", + "type" : "string" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE", + "role" ], + "additionalProperties" : false }, + "remarks" : + { "title" : "Remarks", + "description" : "Pertinent information of any kind.", + "type" : "string" }, + "piece" : + { "title" : "Piece", + "description" : "A single anthologized piece; poetry or prose, entire or excerpted", + "type" : "object", + "properties" : + { "meta" : + { "$ref" : "#/definitions/meta" }, + "verse" : + { "$ref" : "#/definitions/verse" }, + "prose" : + { "$ref" : "#/definitions/prose" } }, + "additionalProperties" : false }, + "verse" : + { "title" : "Verse", + "description" : "A composition in lines, or an excerpt from such a composition", + "type" : "object", + "properties" : + { "type" : + { "title" : "Verse type", + "description" : "Any specialized form such as Byronic, terza rima, sestina, sonnet", + "type" : "string" }, + "lines" : + { "anyOf" : + [ + { "$ref" : "#/definitions/line" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/line" } } ] }, + "stanzas" : + { "anyOf" : + [ + { "$ref" : "#/definitions/stanza" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/stanza" } } ] } }, + "additionalProperties" : false }, + "line" : + { "title" : "Line of verse", + "description" : "May be metrical", + "type" : "object", + "properties" : + { "feet" : + { "title" : "Meter count(feet)", + "description" : "Count of metrical feet (dimeter, trimeter, tetrameter etc) represented as a natural number", + "type" : "integer" }, + "base" : + { "title" : "Base meter", + "description" : "Identifies the base metrical type, if any", + "type" : "string", + "enum" : + [ "dactyl", + "anapest", + "trochee", + "iamb", + "mixed" ] }, + "RICHTEXT" : + { "type" : "string" } }, + "required" : + [ "RICHTEXT" ], + "additionalProperties" : false }, + "stanza" : + { "title" : "Stanza", + "description" : "A group of lines within a verse", + "type" : "object", + "properties" : + { "type" : + { "title" : "Verse type", + "description" : "Any specialized form such as Byronic, terza rima, sestina, sonnet", + "type" : "string" }, + "lines" : + { "anyOf" : + [ + { "$ref" : "#/definitions/line" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/line" } } ] } }, + "additionalProperties" : false }, + "prose" : + { "title" : "Prose", + "description" : "Short prose or an excerpt", + "type" : "string" }, + "back" : + { "title" : "Back matter", + "description" : "Indexes and appurtenances", + "type" : "object", + "properties" : + { "author-index" : + { "$ref" : "#/definitions/author-index" } }, + "additionalProperties" : false }, + "author-index" : + { "title" : "Author index", + "description" : "Information about authors cited in the anthology", + "type" : "object", + "properties" : + { "authors" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "type" : "object", + "$ref" : "#/definitions/author" }, + + { "not" : + { "type" : "string" } } ] } } }, + "additionalProperties" : false }, + "author" : + { "title" : "Author", + "description" : "A single author cited in the anthology, with relevant info", + "type" : "object", + "properties" : + { "name" : + { "$ref" : "#/definitions/name" }, + "dates" : + { "$ref" : "#/definitions/dates" }, + "publications" : + { "anyOf" : + [ + { "$ref" : "#/definitions/publication" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/publication" } } ] }, + "bio" : + { "$ref" : "#/definitions/bio" } }, + "additionalProperties" : false }, + "name" : + { "title" : "Name", + "description" : "A personal or place name", + "type" : "string" }, + "bio" : + { "title" : "Biographical info", + "description" : "Gives basic facts or colorful detail.", + "type" : "object", + "properties" : + { "also-known-as" : + { "anyOf" : + [ + { "$ref" : "#/definitions/name" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/name" } } ] }, + "fact-statements" : + { "anyOf" : + [ + { "facts" : + { "title" : "Facts", + "description" : "Structured data", + "type" : "object", + "properties" : + { "dates" : + { "$ref" : "#/definitions/dates" }, + "residences" : + { "anyOf" : + [ + { "residence" : + { "title" : "Residency", + "description" : "A range of values in time-space", + "type" : "object", + "properties" : + { "dates" : + { "dates" : + { "title" : "Dates", + "description" : "Start to end", + "type" : "object", + "properties" : + { "start" : + { "title" : "Start", + "description" : "When initiated", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "end" : + { "title" : "End", + "description" : "When concluded or abandoned", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, + "additionalProperties" : false } } }, + "additionalProperties" : false } }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "residence" : + { "title" : "Residency", + "description" : "A range of values in time-space", + "type" : "object", + "properties" : + { "dates" : + { "dates" : + { "title" : "Dates", + "description" : "Start to end", + "type" : "object", + "properties" : + { "start" : + { "title" : "Start", + "description" : "When initiated", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "end" : + { "title" : "End", + "description" : "When concluded or abandoned", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, + "additionalProperties" : false } } }, + "additionalProperties" : false } } } ] } }, + "additionalProperties" : false } }, + + { "type" : "array", + "maxItems" : 3, + "minItems" : 1, + "items" : + { "facts" : + { "title" : "Facts", + "description" : "Structured data", + "type" : "object", + "properties" : + { "dates" : + { "$ref" : "#/definitions/dates" }, + "residences" : + { "anyOf" : + [ + { "residence" : + { "title" : "Residency", + "description" : "A range of values in time-space", + "type" : "object", + "properties" : + { "dates" : + { "dates" : + { "title" : "Dates", + "description" : "Start to end", + "type" : "object", + "properties" : + { "start" : + { "title" : "Start", + "description" : "When initiated", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "end" : + { "title" : "End", + "description" : "When concluded or abandoned", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, + "additionalProperties" : false } } }, + "additionalProperties" : false } }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "residence" : + { "title" : "Residency", + "description" : "A range of values in time-space", + "type" : "object", + "properties" : + { "dates" : + { "dates" : + { "title" : "Dates", + "description" : "Start to end", + "type" : "object", + "properties" : + { "start" : + { "title" : "Start", + "description" : "When initiated", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "end" : + { "title" : "End", + "description" : "When concluded or abandoned", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" } }, + "additionalProperties" : false } } }, + "additionalProperties" : false } } } ] } }, + "additionalProperties" : false } } } ] }, + "colorful-details" : + { "colorful-details" : + { "title" : "Colorful details", + "description" : "Unstructured data", + "type" : "object", + "properties" : + { "dates" : + { "dates" : + { "title" : "Dates", + "description" : "This time, a string, so \"Lincoln's Birthday\" is a date.", + "type" : "string" } }, + "remarks" : + { "$ref" : "#/definitions/remarks" } }, + "additionalProperties" : false } } }, + "additionalProperties" : false }, + "dates" : + { "title" : "Dates", + "description" : "As a range (birth-death) or floruit", + "type" : "object", + "properties" : + { "birth" : + { "title" : "Birth date", + "description" : "If only the year is known use June 30.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "death" : + { "title" : "Death date", + "description" : "If only the year is known use July 1.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "floruit" : + { "title" : "Floruit date", + "description" : "Do not use along with both birth and death", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "range" : + { "type" : "string" } }, + "required" : + [ "range" ], + "additionalProperties" : false }, + "publication" : + { "title" : "Publication", + "description" : "A publication attributed to an author", + "type" : "object", + "properties" : + { "date" : + { "title" : "Publication date", + "description" : "Date of (first) publication", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false } }, + "properties" : + { "ANTHOLOGY" : + { "$ref" : "#/definitions/ANTHOLOGY" } }, + "required" : + [ "ANTHOLOGY" ] } \ No newline at end of file diff --git a/test-suite/worked-examples/anthology/valid-flag-check.xml b/test-suite/worked-examples/anthology/valid-flag-check.xml new file mode 100644 index 000000000..cd3d1c0b7 --- /dev/null +++ b/test-suite/worked-examples/anthology/valid-flag-check.xml @@ -0,0 +1,14 @@ + + + + + + + Rochester NY + + + + + \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd b/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd new file mode 100644 index 000000000..3cdeaaae4 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything-handmade.xsd @@ -0,0 +1,87 @@ + + + + + + NIST Metaschema Everything + 1.0 + everything + + + + + + + + + + Every Thing + Nothing left out. + + + Every Thing: Nothing left out. + + + + + + + + + + + + + + + + + + One String + Not more than one. + + + One String: Not more than one. + + + + + + + + + + + Customized Field + A declaration that can be overridden locally. + + + Customized Field: A declaration that can be overridden locally. + + + + + + + + + + + + + +

thousand

+
+
+
+
+
+
+
+
diff --git a/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch b/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch new file mode 100644 index 000000000..a0091ad38 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything-metaschema_METATRON.sch @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + Where ancestor::everything:stanza/@type='couplet', is expected to have exactly 2 occurrences of line + + Where ancestor::everything:stanza/@type='tercet', is expected to have exactly 3 occurrences of line + + Where ancestor::everything:stanza/@type='quatrain', is expected to have exactly 4 occurrences of line + + + Where @type='type', is expected to be (one of) 'start', 'end', not '' + + + + + + is expected to be (one of) 'Alpha', 'Beta', 'Gamma', not '' + + + + + + Where (empty( self::everything:expectation[@type='oneof'] )), is expected to be unique within the containing + + + + + is expected to be (one of) 'date', 'color', 'wholeNo', 'ID', not '' + + + + is expected to match regular expression '^\S' + + + Where ancestor::everything:widget/@banner-type='date', is expected to take the form of datatype date' + + Where ancestor::everything:widget/@banner-type='color', is expected to be (one of) 'red', 'blue', 'green', not '' + + Where ancestor::everything:widget/@banner-type='wholeNo', is expected to match regular expression '^\d+$' + + + + is expected to be (one of) 'couplet', 'tercet', 'quatrain', not '' + + + + is expected to be (one of) 'type', 'date', 'roleref', 'oneof', not '' + + + + is expected to take the form of datatype decimal' + + + + is expected to take the form of datatype decimal' + + + Where @who='ghost', is expected to be (one of) 'Boo!', not '' + + Where @class='has-a', is expected to match regular expression 'a|A' + + Where (empty( self::everything:line[@who='ghost'] )), is expected to be (one of) 'Boo!', not '' + + Where (empty( self::everything:line[@class='has-a'] )), is expected to match regular expression 'a|A' + + + + + + Where ancestor::everything:expectation/@type='date', is expected to take the form of datatype date' + + + Where ancestor::everything:expectation/@type='roleref', is expected to correspond to an entry in the '' index within the containing + + + + + + + + + + string + string + NCName + { $nominal-type } + + + + {$value} + + + + + + + + + + diff --git a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch new file mode 100644 index 000000000..ccb6354d8 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup.sch @@ -0,0 +1,62 @@ + + + + + + + + Here be + + + + + + + + + + + + + + Ghost only says Boo! + Ghost only says Boo! + + + Colors must be red or pink + + + + + when @type='type', an expectation value should be one of 'start', 'end' + + + 'role-index' index returns nothing for key '': this everything has no role with this @role-id + + + + Biggish + + + + \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch new file mode 100644 index 000000000..65c43baa7 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything-metatron-mockup2.sch @@ -0,0 +1,38 @@ + + + + + + + /. '' is expected to be one of 'date', 'color', 'wholeNo', 'ID' + + + + /@banner '' is expected to match regular expression '^\d+$' + Where @banner-type='color', /@banner '' is expected to be one of 'red', 'blue', 'green' + Where @banner-type='wholeNo', /@banner '' is expected to match regular expression '^\d+$' + + + + /. '' is expected to be one of 'couplet', 'tercet', 'quatrain' + + + Where @type='couplet', / everything:line is expected to occur exactly 2 times + Where @type='tercet', / everything:line is expected to occur exactly 3 times + Where @type='quatrain', / everything:line is expected to occur exactly 4 times + + + + /. '' is expected to be one of 'type', 'date', 'roleref', 'oneof' + + + Where @type='type', /data() '' is expected to be one of 'start', 'end' + + + + /. '' is expected to be one of 'Alpha', 'Beta', 'Gamma' + + + diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json b/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json new file mode 100644 index 000000000..e8be4f98d --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema-hand-schema.json @@ -0,0 +1,197 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://csrc.nist.gov/metaschema/ns/everything-schema.json", + "$comment": "NIST Metaschema Everything: JSON Schema", + "type": "object", + "definitions": { + "ANYTHING": { + "title": "Any Thing", + "description": "Any old thing.", + "$id": "#anythingXX", + "type": "object", + "properties": { + "todays-date": { + "title": "Today's Date", + "description": "Not before yesterday.", + "type": "string", + "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" + } + }, + "additionalProperties": false + }, + "EVERYTHING": { + "title": "Every Thing", + "description": "Nothing left out.", + "$id": "#/definitions/everything", + "type": "object", + "properties": { + "todays-date": { + "title": "Today's Date", + "description": "Not before yesterday.", + "type": "string", + "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" + }, + "required-integer": { + "title": "Required Integer", + "description": "An integer.", + "type": "integer" + } + }, + "required": [ + "required-integer", + "required-local-field", + "singleton" + ], + "additionalProperties": false + }, + "singleton": { + "title": "Singleton assembly", + "description": "One of a kind.", + "$id": "#/definitions/singleton", + "type": "object", + "properties": { + "todays-date": { + "title": "Today's Date", + "description": "Not before yesterday.", + "type": "string", + "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" + } + }, + "required": ["title"], + "additionalProperties": false + }, + "section": { + "title": "Section", + "description": ".", + "$id": "#/definitions/section", + "type": "object", + "properties": { + "class": { + "title": "Class", + "description": ".", + "type": "string" + } + }, + "additionalProperties": false + }, + "color": { + "title": "Color", + "description": "Name and code", + "$id": "#/definitions/color", + "type": "object", + "properties": { + "STRVALUE": {"type": "string"} + }, + "required": ["STRVALUE"], + "additionalProperties": false + }, + "point": { + "title": "Point", + "description": "Point location", + "$id": "#/definitions/point", + "type": "object", + "properties": { + "x": { + "title": "X", + "description": "Abscissa", + "type": "number", + "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" + }, + "y": { + "title": "Y", + "description": "ordinate", + "type": "number", + "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" + } + }, + "additionalProperties": false + }, + "role": { + "title": "Role", + "description": ".", + "$id": "#/definitions/role", + "type": "object", + "additionalProperties": false + }, + "line": { + "title": "Line of verse", + "description": "Could be terse", + "$id": "#/definitions/line", + "type": "string" + }, + "title": { + "title": "Title", + "description": ".", + "$id": "#/definitions/title", + "type": "string" + }, + "prose": { + "title": "Prose", + "description": "A placeholder for prose in an explicit model.", + "$id": "#/definitions/prose", + "type": "string" + }, + "remarks": { + "title": "Prose", + "description": "A block o' prose.", + "$id": "#/definitions/remarks", + "type": "string" + }, + "named-value": { + "title": "Named value", + "description": "A field with a json value flag", + "$id": "#/definitions/named-value", + "type": "object", + "properties": { + "class": { + "title": "Class", + "description": "Some class.", + "type": "string" + } + }, + "minProperties": 1, + "maxProperties": 2 + }, + "one-string": { + "title": "One String", + "description": "Not more than one.", + "$id": "#/definitions/one-string", + "type": "object", + "properties": { + "todays-date": { + "title": "Today's Date", + "description": "Not before yesterday.", + "type": "string", + "pattern": "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" + }, + "required-ncname": { + "title": "Required NCName", + "description": "A no-colon name.", + "type": "string" + }, + "STRVALUE": {"type": "string"} + }, + "required": ["STRVALUE"], + "additionalProperties": false, + "enum": [ + "Alpha", + "Beta", + "Gamma" + ] + } + }, + "oneOf": [ + { + "properties": { + "ANYTHING": {"$ref": "#/definitions/ANYTHING"} + }, + "required": ["ANYTHING"] + }, + { + "properties": { + "EVERYTHING": {"$ref": "#/definitions/EVERYTHING"} + }, + "required": ["EVERYTHING"] + } + ] +} \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml b/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml new file mode 100644 index 000000000..77048dad7 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema_COMPOSED.xml @@ -0,0 +1,416 @@ + + NIST Metaschema Everything + 1.0 + everything + http://csrc.nist.gov/metaschema/ns/everything + +

A mini metaschema produced for testing purposes. Use at your own risk.

+
+ + Any Thing + Any old thing. + ANYTHING + + + + everything + + + + + Every Thing + Nothing left out. + EVERYTHING + + + Required Integer + An integer. + + + + Required local field + Declared on 'everything' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + everything + + + + + + + + + + + + + + Widget + With knobs and switches. + + Banner type + How should we check the banner (a flag) + + + Date type + Color + Lexically, a whole number (\d+) + A unique identifier + + + + + Banner + A flag, with a dynamic (lexical) type + + + + + + + + + + + + + + + Red + Blue + Green + + + + + + + + + + + + + + Verse stanza + A sequence of lines of determinate length + + Verse type + Be creative + + + Couplet + Tercet + Quatrain + + + + + + + + + + + + + + + + + + + + + + Expectation + Something that may or may not occur in the future. + + Expectation type + Saying something about an expectation. + + + type + date + role reference + a unique set of values + + + + + + + start + end + + + + + + + + + + + + + + Singleton assembly + One of a kind. + SINGLETON + + + + + + + + Section + . + + + id + . + + + Class + . + + + + + + + + + + + + Color + Name and code + + + Code + The six-digit hex code, so FF0000 for red + + + + Point + Point location + + + Point ID + A name for the point + + + X + Abscissa + + + Y + ordinate + + + + + + + + + + + Role + . + + + Role ID + A unique identifier for the role + + + + + + + + + + + + + + + + Line of verse + Could be terse + + + Title + . + + + Prose + A placeholder for prose in an explicit model. + + + Skit + An exchange of lines + + + line of a skit + A single spoken line + + + + Who + Who speaks the line + + + + + + + + + + + + + + + + + + + + + + Prose + A block o' prose. + + + Named value + A field with a json value flag + + + + Name + The name for the value + + + + Greek letter + Not more than one, spelled out, but only ɑ, β and γ + + + + + + + + + + + + Today's Date + Not before yesterday. + + + Required NCName + A no-colon name. + + + Class + Some class. + +
diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json b/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json new file mode 100644 index 000000000..b171a27cf --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema_JSON-SCHEMA.json @@ -0,0 +1,250 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/metaschema/ns/everything-schema.json", + "$comment" : "NIST Metaschema Everything: JSON Schema", + "type" : "object", + "definitions" : + { "ANYTHING" : + { "title" : "Any Thing", + "description" : "Any old thing.", + "type" : "object", + "properties" : + { "todays-date" : + { "title" : "Today's Date", + "description" : "Not before yesterday.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "EVERYTHING" : + { "$ref" : "#/definitions/EVERYTHING" } }, + "additionalProperties" : false }, + "EVERYTHING" : + { "title" : "Every Thing", + "description" : "Nothing left out.", + "type" : "object", + "properties" : + { "todays-date" : + { "title" : "Today's Date", + "description" : "Not before yesterday.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "required-integer" : + { "title" : "Required Integer", + "description" : "An integer.", + "type" : "integer" }, + "required-local-field" : + { "title" : "Required local field", + "description" : "Declared on 'everything'", + "type" : "string" }, + "one-string" : + { "$ref" : "#/definitions/one-string" }, + "epigraph" : + { "anyOf" : + [ + { "$ref" : "#/definitions/line" }, + + { "type" : "array", + "minItems" : 2, + "items" : + { "$ref" : "#/definitions/line" } } ] }, + "colors" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "type" : "object", + "$ref" : "#/definitions/color" }, + + { "not" : + { "type" : "string" } } ] } }, + "lattice" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "type" : "object", + "$ref" : "#/definitions/point" }, + + { "not" : + { "type" : "string" } } ] } }, + "dramatis-personae" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "type" : "object", + "$ref" : "#/definitions/role" }, + + { "not" : + { "type" : "string" } } ] } }, + "SINGLETON" : + { "$ref" : "#/definitions/SINGLETON" }, + "sections" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "type" : "object", + "$ref" : "#/definitions/section" }, + + { "not" : + { "type" : "string" } } ] } }, + "everythings" : + { "anyOf" : + [ + { "$ref" : "#/definitions/EVERYTHING" }, + + { "type" : "array", + "maxItems" : 3, + "minItems" : 2, + "items" : + { "$ref" : "#/definitions/EVERYTHING" } } ] } }, + "required" : + [ "required-integer", + "required-local-field", + "SINGLETON" ], + "additionalProperties" : false }, + "SINGLETON" : + { "title" : "Singleton assembly", + "description" : "One of a kind.", + "type" : "object", + "properties" : + { "todays-date" : + { "title" : "Today's Date", + "description" : "Not before yesterday.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "title" : + { "$ref" : "#/definitions/title" }, + "remarks" : + { "$ref" : "#/definitions/remarks" } }, + "required" : + [ "title" ], + "additionalProperties" : false }, + "section" : + { "title" : "Section", + "description" : ".", + "type" : "object", + "properties" : + { "class" : + { "title" : "Class", + "description" : ".", + "type" : "string" }, + "title" : + { "$ref" : "#/definitions/title" }, + "named-value" : + { "$ref" : "#/definitions/named-value" }, + "epigraph" : + { "anyOf" : + [ + { "$ref" : "#/definitions/line" }, + + { "type" : "array", + "minItems" : 2, + "items" : + { "$ref" : "#/definitions/line" } } ] }, + "prose" : + { "$ref" : "#/definitions/prose" } }, + "additionalProperties" : false }, + "color" : + { "title" : "Color", + "description" : "Name and code", + "type" : "object", + "properties" : + { "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false }, + "point" : + { "title" : "Point", + "description" : "Point location", + "type" : "object", + "properties" : + { "x" : + { "title" : "X", + "description" : "Abscissa", + "type" : "number", + "pattern" : "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" }, + "y" : + { "title" : "Y", + "description" : "ordinate", + "type" : "number", + "pattern" : "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" } }, + "additionalProperties" : false }, + "role" : + { "title" : "Role", + "description" : ".", + "type" : "object", + "properties" : + { "title" : + { "$ref" : "#/definitions/title" }, + "remarks" : + { "$ref" : "#/definitions/remarks" } }, + "additionalProperties" : false }, + "line" : + { "title" : "Line of verse", + "description" : "Could be terse", + "type" : "string" }, + "title" : + { "title" : "Title", + "description" : ".", + "type" : "string" }, + "prose" : + { "title" : "Prose", + "description" : "A placeholder for prose in an explicit model.", + "type" : "string" }, + "remarks" : + { "title" : "Prose", + "description" : "A block o' prose.", + "type" : "string" }, + "named-value" : + { "title" : "Named value", + "description" : "A field with a json value flag", + "type" : "object", + "properties" : + { "class" : + { "title" : "Class", + "description" : "Some class.", + "type" : "string" } }, + "minProperties" : 1, + "maxProperties" : 2 }, + "one-string" : + { "title" : "One String", + "description" : "Not more than one.", + "type" : "object", + "properties" : + { "todays-date" : + { "title" : "Today's Date", + "description" : "Not before yesterday.", + "type" : "string", + "pattern" : "^((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-][0-9]{2}:[0-9]{2})?$" }, + "required-ncname" : + { "title" : "Required NCName", + "description" : "A no-colon name.", + "type" : "string" }, + "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false, + "enum" : + [ "Alpha", + "Beta", + "Gamma" ] } }, + "oneOf" : + [ + { "properties" : + { "ANYTHING" : + { "$ref" : "#/definitions/ANYTHING" } }, + "required" : + [ "ANYTHING" ] }, + + { "properties" : + { "EVERYTHING" : + { "$ref" : "#/definitions/EVERYTHING" } }, + "required" : + [ "EVERYTHING" ] } ] } \ No newline at end of file diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd b/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd new file mode 100644 index 000000000..ded01f052 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema_XML-SCHEMA.xsd @@ -0,0 +1,866 @@ + + + + + NIST Metaschema Everything + 1.0 + everything + +

A mini metaschema produced for testing purposes. Use at your own risk.

+
+ ANYTHING + EVERYTHING +
+
+ + + + + Any Thing + Any old thing. + + + Any Thing: Any old thing. + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + + + Every Thing + Nothing left out. + + + Every Thing: Nothing left out. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + Required Integer + An integer. + + + Required Integer: An integer. + + + + + + + Widget + With knobs and switches. + + + Widget: With knobs and switches. + + + + + + + + + Banner type + How should we check the banner (a flag) + + + Banner type: How should we check the banner (a flag) + + + + + + +

Date type

+
+
+
+ + + +

Color

+
+
+
+ + + +

Lexically, a whole number (\d+)

+
+
+
+ + + +

A unique identifier

+
+
+
+
+
+
+ + + + Banner + A flag, with a dynamic (lexical) type + + + Banner: A flag, with a dynamic (lexical) type + + +
+ + + + Verse stanza + A sequence of lines of determinate length + + + Verse stanza: A sequence of lines of determinate length + + + + + + + + Verse type + Be creative + + + Verse type: Be creative + + + + + + + + +

Couplet

+
+
+
+ + + +

Tercet

+
+
+
+ + + +

Quatrain

+
+
+
+
+
+
+
+
+
+ + + + Expectation + Something that may or may not occur in the future. + + + Expectation: Something that may or may not occur in the future. + + + + + + + Expectation type + Saying something about an expectation. + + + Expectation type: Saying something about an expectation. + + + + + + +

type

+
+
+
+ + + +

date

+
+
+
+ + + +

role reference

+
+
+
+ + + +

a unique set of values

+
+
+
+
+
+
+
+
+
+ + + + Singleton assembly + One of a kind. + + + Singleton assembly: One of a kind. + + + + + + + Prose + A block o' prose. + + + Prose: A block o' prose. + + + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + + Section + . + + + Section: . + + + + + + + + + + + + + + + + + id + . + + + id: . + + + + + + Class + . + + + Class: . + + + + + + + Color + Name and code + + + Color: Name and code + + + + + + + Code + The six-digit hex code, so FF0000 for red + + + Code: The six-digit hex code, so FF0000 for red + + + + + + + + + + Role + . + + + Role: . + + + + + + + Prose + A block o' prose. + + + Prose: A block o' prose. + + + + + + + + + + Role ID + A unique identifier for the role + + + Role ID: A unique identifier for the role + + + + + + + + + + + + + Skit + An exchange of lines + + + Skit: An exchange of lines + + + + + + + + + Class + Some class. + + + Class: Some class. + + + + + + + + + + Named value + A field with a json value flag + + + Named value: A field with a json value flag + + + + + + + Class + Some class. + + + Class: Some class. + + + + + + Name + The name for the value + + + Name: The name for the value + + + + + + + + + Greek letter + Not more than one, spelled out, but only ɑ, β and γ + + + Greek letter: Not more than one, spelled out, but only ɑ, β and γ + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + Required NCName + A no-colon name. + + + Required NCName: A no-colon name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd b/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd new file mode 100644 index 000000000..0d54fb9e4 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_metaschema_hand-keys.xsd @@ -0,0 +1,639 @@ + + + + + NIST Metaschema Everything + 1.0 + everything + +

A mini metaschema produced for testing purposes. Use at your own risk.

+
+ ANYTHING + EVERYTHING +
+
+ + + + + + + + + + Any Thing + Any old thing. + + + Any Thing: Any old thing. + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + + + + + + + Every Thing + Nothing left out. + + + Every Thing: Nothing left out. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + Required Integer + An integer. + + + Required Integer: An integer. + + + + + + + Singleton assembly + One of a kind. + + + Singleton assembly: One of a kind. + + + + + + + Prose + A block o' prose. + + + Prose: A block o' prose. + + + + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + + Section + . + + + Section: . + + + + + + + + + + + + + + + + + id + . + + + id: . + + + + + + Class + . + + + Class: . + + + + + + + Color + Name and code + + + Color: Name and code + + + + + + + Code + The six-digit hex code, so FF0000 for red + + + Code: The six-digit hex code, so FF0000 for red + + + + + + + + + + Role + . + + + Role: . + + + + + + + Prose + A block o' prose. + + + Prose: A block o' prose. + + + + + + + + + + Role ID + A unique identifier for the role + + + Role ID: A unique identifier for the role + + + + + + + + + + + + + Named value + A field with a json value flag + + + Named value: A field with a json value flag + + + + + + + Class + Some class. + + + Class: Some class. + + + + + + Name + The name for the value + + + Name: The name for the value + + + + + + + + + One String + Not more than one. + + + One String: Not more than one. + + + + + + + Today's Date + Not before yesterday. + + + Today's Date: Not before yesterday. + + + + + + Required NCName + A no-colon name. + + + Required NCName: A no-colon name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html b/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html new file mode 100644 index 000000000..c7aec5cf4 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/everything_xml-model-map.html @@ -0,0 +1,103 @@ + + + + + +

<>

+
+ <everything + todays-date="date"> [0 or 1] + +
+
+

<one-string + todays-date="date" required-ncname="NCName">string</one-string> [0 or 1] +

+

+ + Markup multiline + +

+
+ <section> [0 or 1] + +
+
+

<title>markup-line</title> [0 or 1] +

+

+ + Markup multiline + +

+

+ + Markup multiline + +

+
+
+

</section>

+
+

<everything/> [0 to 3] +

+
+
+

</everything>

+
+
+
+

<one-string + todays-date="date" required-ncname="NCName">string</one-string> [0 or 1] +

+

+ + Markup multiline + +

+
+ <section> [0 or 1] + +
+
+

<title>markup-line</title> [0 or 1] +

+

+ + Markup multiline + +

+

+ + Markup multiline + +

+
+
+

</section>

+
+

<everything/> [0 to 3] +

+
</> [0 or 1] +

+ + diff --git a/test-suite/worked-examples/everything-metaschema/exercise-everything.xml b/test-suite/worked-examples/everything-metaschema/exercise-everything.xml new file mode 100644 index 000000000..f52b390b1 --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/exercise-everything.xml @@ -0,0 +1,96 @@ + + + + + field! + + + + + + + Ye Singleton + + + required + Alpha + + + Boo! + Caw! + Boo! + + + + + + + + + + + required + + Aleph + + + + + + + + + + + + + ERRORS + + + diff --git a/test-suite/worked-examples/everything-metaschema/kitchen-sink.json b/test-suite/worked-examples/everything-metaschema/kitchen-sink.json new file mode 100644 index 000000000..2765b4eab --- /dev/null +++ b/test-suite/worked-examples/everything-metaschema/kitchen-sink.json @@ -0,0 +1,7 @@ +{ + "EVERYTHING": { "todays-date": "2020-02-19", + "one-string": "Alpha", + "required-integer": 3, + "required-local-field": "um", + "SINGLETON": { "title": "My Summer Vacation" } } +} \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/lib/metaschema-check-m2.sch b/toolchains/xslt-proto-v04/lib/metaschema-check-m2.sch new file mode 100644 index 000000000..bb90009b4 --- /dev/null +++ b/toolchains/xslt-proto-v04/lib/metaschema-check-m2.sch @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Definition for '' is not unique in this metaschema; cf . + formal-name missing from + description missing from + model missing from + Property defined as boolean may not have flags. + is assigned a json key, but no 'json-key' is given + Names "STRVALUE", "RICHTEXT" or "PROSE" (reserved names) + + + + + + JSON key indicates no flag on this + Should be (one of) + + + + JSON value key may be set to a value or a flag's value, but not both. + flag '' not found for JSON value key + + + + Value '' may only be + specified once for flag ''. + + Value '' is not a valid token of type + + + + + Flag declaration must have 'name' or 'ref' + Flag declaration may be by name or reference, not both (remove @name or @ref) + A flag referencing an existing declaration must not specify a data type + + A flag declared as a value key must be required (@required='yes') + Only one flag may be named + + No definition found for '' + Flag data type doesn't match: the definition has '' + Flag should not be named "STRVALUE", "RICHTEXT" or "PROSE" (reserved names) + + + + + + + + + No definition found for '' + Target definition for { @ref} designates a json key, so + the invocation should have group-as/@in-json='BY_KEY' + Everything named the same must appear together + Clashing name with group name: + + Unless @max-occurs is 1, + a grouping name (group-as/@name) must be given + + A field referencing an existing declaration must not specify a data type + + Only 'markup-multiline' fields may be unwrapped in XML. + An 'unwrapped' field must have a max occurrence of 1 + All fields '" should have @in-xml set the same. + Only one field may be marked + as 'markup-multiline' (without xml wrapping) within a model. + + + + + + Name clash on '' + "group-as" should not be given when max-occurs is 1. + Cannot group by key since the definition of + '' has no json-key specified. Consider adding a json-key to the '' definition, or using a different 'in-json' setting. + + + + + + + + Unexpected namespace: examples should use namespace '' + + + + Empty paragraph (is likely to distort rendition) + + + + + + METASCHEMA/@root should be one of + Metaschema schema version must be set for any top-level metaschema + + + + Schema can't import itself + Can't find a metaschema at + + + + + Definition for assembly '' is not used. + + + + + Definition for field '' is not used. + + + + + Definition for flag '' is not used. + + + Assembly '' invocation does not point to an assembly definition. + We expect one of + '' is a field, not an assembly. + '' is a flag, not an assembly. + + + Field invocation '' does not point to a field definition. + We expect one of + '' is an assembly, not a field. + '' is a flag, not an assembly. + + + + + Flag invocation '' does not point to a flag definition. + + + '' is a field, not a flag. + '' is an assembly, not a flag. + + + + Named flag expects a 'formal-name' + Named flag expects a 'description' + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/lib/metaschema-compose-m2-mod.xsl b/toolchains/xslt-proto-v04/lib/metaschema-compose-m2-mod.xsl new file mode 100644 index 000000000..677d41978 --- /dev/null +++ b/toolchains/xslt-proto-v04/lib/metaschema-compose-m2-mod.xsl @@ -0,0 +1,273 @@ + + + + + + + + + + no + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Warning: circular import of { $uri } skipped + + + + + + + + + + + + + + + + + + + + + + + + + KEEPING definition for '{ @name }' assembly from { ancestor::METASCHEMA[1]/@module } + + + + + + + + + + + KEEPING definition for '{ @name }' { + replace(local-name(),'^define-','')} from { ancestor::METASCHEMA[1]/@module + } + + + + + + + + TOSSING definition for '{ @name }' { replace(local-name(),'^define-','')} from { ancestor::METASCHEMA[1]/@module } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formal name override for { replace(local-name(),'^define-','')} '{ @name }': using "{ $me-and-mine[last()]/formal-name }" + + + + + + + + + + + + + + + DISCARDING definition for '{ @name }' { replace(local-name(),'^define-','')} from { ancestor::METASCHEMA[1]/@module } (not being used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/lib/metaschema-m2.xsd b/toolchains/xslt-proto-v04/lib/metaschema-m2.xsd new file mode 100644 index 000000000..81c98eec8 --- /dev/null +++ b/toolchains/xslt-proto-v04/lib/metaschema-m2.xsd @@ -0,0 +1,566 @@ + + + + + + + + Root element of an OSCAL Metaschema metaschema. Defines a family of data + structures. + + + + + + + + + + + + + + + + + + + + + + + + An element with structured element content in XML; in JSON, an object with + properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In JSON, an object with a nominal string value (potentially with internal + inline - not fully structured - markup). In XML, an element with string or mixed + content. + + + + + + + + + + + + + + + + + + + + + + + In the XML, produces an attribute with the given name, whose value is used as a key value (aka object property name) in the JSON, enabling objects to be 'lifted' out of arrays when such values are distinct. Implies that siblings will never share values. Overloading with datatype 'ID' and naming the key 'id' is legitimate and useful. Even without ID validation, uniqueness of these values among siblings is validable. + + + + + + + + + + When a given referenced field or assembly must be wrapped in an outer grouping, these settings apply, including a name for the group, and how to express the grouping in the respective formats. Not necessary when a field or assembly has max-occurs='1' + + + + + + How to represent a grouping in JSON + + + + + Whether to represent a grouping explicitly in XML + + + + + + + + + + Always use an array + + + + + Produce a singleton for a single member (field or assembly) or an array for multiple members + + + + + For any group (one or more members) produce an object with properties for each member, using a designated flag for their key (label) values, which must be distinct + + + + + + + + + Use a wrapper element + + + + + Do not use a wrapper element + + + + + + + + + Used inside a field definition, designates + a flag to be used as a label (key) to be used for the field value in the JSON on + the field being defined. When a flag-name is provided, indicates that the value of the field + is to be labeled in the JSON with the value of the flag. + + + + + + + + + A data point to be expressed as an attribute in the XML or a name/value pair + in the JSON. A flag may also be defined implicitly with the assembly or field to which it applies. + + + + + + + + + + + + + + + + + + + + A formal name for the data construct, to be presented in documentation. It + is permissible for a formal name to provide nothing but an expanson of what is already given + by a tag (for example, this element could have formal name "Formal name") but it should at + the very least confirm the intended semantics for the user, not confuse them. + + + + + + The XML namespace governing the names of elements in XML documents, which + expect to be conformant to the schemas expressed by this metaschema. By using this + namespace, documents and document fragments used in mixed-format environments may be + distinguished from neighbor XML formats using other namespaces. NB this is only for the + convenience of XML users; this value is not reflected in OSCAL JSON, and OSCAL applications + should not rely on namespaces alone to disambiguate or resolve semantics. + + + + + + + + + + + + + + + + + + A short description of the data construct, to be inserted into + documentation. Unlike 'formal-name' this should not simply repeat what is readily + discernible from a tag (element name or JSON label), but say a little more about + it. + + + + + + + + + Any explanatory or helpful information to be provided in the + documentation of an assembly, field or flag. + + + + + + + + Mark as 'XML' for XML-only or 'JSON' for JSON-only remarks. + + + + + + + + + The name of the information model to be represented by derived schemas. + + + + + + + + + + + + The version of the information model to be represented by derived schemas. + + + + + + + A short (code) name to be used for the metaschema, for example as a constituent of names assigned to + derived artifacts such as schemas and conversion utilities. + + + + + + + To import a set of declarations from an out-of-line schema, supporting reuse of common information structures. + + + + + A relative or absolute URI for retrieving an out-of-line metaschema module. + + + + + + + + Referencing an assembly definition to include an assembly or assemblies of a given type in a model. + + + + + + + + + + + + Minimum occurrence of assemblies within a valid model. The default value is 0, for an optional occurrence. + + + + + Maximum occurrence of assemblies within a valid model. The default value is 1, for a single occurrence. 'unbounded' permits any number of assemblies of the designated type. + + + + + + + + Referencing a field definition to include a field or fields of a given type in a model. + + + + + + + + + + + + + + Minimum occurrence of assemblies within a valid model. The default value is 0, for an optional occurrence. + + + + + Maximum occurrence of assemblies within a valid model. The default value is 1, for a single occurrence. 'unbounded' permits any number of assemblies of the designated type. + + + + + A field with assigned datatype 'markup-multiline' may be designated for representation with or without a containing (wrapper) element + in XML. + + + + + + Any paragraph or block contents of a markup-multiline field will be represented with a containing (wrapper) element in the XML. + + + + + With in-xml='UNWRAPPED', a field contents will be represented in the XML with no wrapper, so the field will be implicit. Among sibling fields in a given model, only one of them may be designated as UNWRAPPED. + + + + + + + + + + + + + + + + + + + + + With in-xml='UNWRAPPED', a field contents will be represented in the XML with no wrapper. The field itself will be implicit, to be inferred from the presence of the contents. Among sibling fields in a given model, only one of them may be designated as UNWRAPPED. + + + + + + Indicates a set of values to be recognized for a flag or field, with semantics asserted by a metaschema enumeration (enum). + + + + + + + The given enumerated value or values are inclusive of other values ('yes') or not ('no', the default) + + + + + + + An enumerated value for a flag or field. The value is indicated by the 'value' attribute while the element contents describe the intended semantics for documentation. + + + + + + A value recognized for a flag or field. + + + + + + + + A paragraph or paragraph fragment, in documentation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Within a model, indicates that only one of a set of fields or assemblies, referenced in the choice, may occur in valid instances. + + + + + + + + + + + + Within a model, a foreign element may be permitted here.. + + + + + + + + + + + + + + + + + + + + + To augment a definition with localized documentation, when a definition from a separate metaschema module is used. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolchains/xslt-proto-v04/lib/oscal-datatypes-m2.xsd b/toolchains/xslt-proto-v04/lib/oscal-datatypes-m2.xsd new file mode 100644 index 000000000..1e7339a19 --- /dev/null +++ b/toolchains/xslt-proto-v04/lib/oscal-datatypes-m2.xsd @@ -0,0 +1,103 @@ + + + + + + The ip-v4-address type specifies an IPv4 address in dot decimal notation. + + + + + + + + + + The ip-v6-address type specifies an IPv6 address represented in 8 hextets separated by colons. + This is based on the pattern provided here: https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses with some customizations. + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + + + + + Need a better pattern. + + + + + + + + + + + + + + Need a better pattern + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/make-metaschema-sandbox.xpl b/toolchains/xslt-proto-v04/make-metaschema-sandbox.xpl new file mode 100644 index 000000000..540d24e55 --- /dev/null +++ b/toolchains/xslt-proto-v04/make-metaschema-sandbox.xpl @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/make-metaschema-xml-to-supermodel-xslt.xpl b/toolchains/xslt-proto-v04/make-metaschema-xml-to-supermodel-xslt.xpl new file mode 100644 index 000000000..5477a3ee9 --- /dev/null +++ b/toolchains/xslt-proto-v04/make-metaschema-xml-to-supermodel-xslt.xpl @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/metapath/metapath-casting-report.html b/toolchains/xslt-proto-v04/metapath/metapath-casting-report.html new file mode 100644 index 000000000..cfac739eb --- /dev/null +++ b/toolchains/xslt-proto-v04/metapath/metapath-casting-report.html @@ -0,0 +1,13 @@ + + + + + +
+

test Run

+
+

 Show

+
+
+ + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/metapath/metapath-casting-result.html b/toolchains/xslt-proto-v04/metapath/metapath-casting-result.html new file mode 100644 index 000000000..957619f7f --- /dev/null +++ b/toolchains/xslt-proto-v04/metapath/metapath-casting-result.html @@ -0,0 +1,985 @@ + + + + Test Report for C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/parse-metapath.xsl (passed: 18 / pending: 0 / failed: 0 / total: 18) + + + +

Test Report

+

Stylesheet: C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/parse-metapath.xsl

+

XSpec: C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/metapath-casting.xspec

+

Tested: 9 April 2020 at 17:16

+

Contents

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
passed: 18pending: 0failed: 0total: 18
Element, implicit child1001
Element, explicit child1001
Already-prefixed element1001
Already-prefixed element, explicit axis1001
Prefix mixup1001
Attribute, abbreviated axis1001
Attribute, explicit axis1001
An attribute on an element1001
Same, but explicit1001
Again, but with descendance (//) operator1001
Element with positional predicate1001
Element with boolean predicate1001
Predicated element with function call in filter1001
Predicated element with function call and path expression in filter1001
Same, a little worse1001
The subexpression in the filter now has a filter1001
More than one step1001
More than one filtered step1001
+
+

Element, implicit childpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Element, implicit childpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Element, explicit childpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Element, explicit childpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Already-prefixed elementpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Already-prefixed elementpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Already-prefixed element, explicit axispassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Already-prefixed element, explicit axispassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Prefix mixuppassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Prefix mixuppassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Attribute, abbreviated axispassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Attribute, abbreviated axispassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Attribute, explicit axispassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Attribute, explicit axispassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

An attribute on an elementpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
An attribute on an elementpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Same, but explicitpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Same, but explicitpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Again, but with descendance (//) operatorpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Again, but with descendance (//) operatorpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Element with positional predicatepassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Element with positional predicatepassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Element with boolean predicatepassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Element with boolean predicatepassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Predicated element with function call in filterpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Predicated element with function call in filterpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Predicated element with function call and path expression in filterpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Predicated element with function call and path expression in filterpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

Same, a little worsepassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
Same, a little worsepassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

The subexpression in the filter now has a filterpassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
The subexpression in the filter now has a filterpassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

More than one steppassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
More than one steppassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+
+

More than one filtered steppassed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
More than one filtered steppassed: 1 / pending: 0 / failed: 0 / total: 1
rewriteSuccess
+
+ + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/metapath/metapath-jsonizing-result.html b/toolchains/xslt-proto-v04/metapath/metapath-jsonizing-result.html new file mode 100644 index 000000000..3046b98d7 --- /dev/null +++ b/toolchains/xslt-proto-v04/metapath/metapath-jsonizing-result.html @@ -0,0 +1,807 @@ + + + + Test Report for C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/metapath-jsonize.xsl (passed: 0 / pending: 0 / failed: 5 / total: 5) + + + +

Test Report

+

Stylesheet: C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/metapath-jsonize.xsl

+

XSpec: C:/Users/wap1/Documents/usnistgov/metaschema/toolchains/xslt-proto-v04/metapath/metapath-jsonizing.xspec

+

Tested: 21 May 2020 at 14:07

+

Contents

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
passed: 0pending: 0failed: 5total: 5
Path to root0011
Nominal document element0011
Absolute path to specified document element0011
A path to a node not described in the definition map0011
Absolute path to document element, with predicate0011
+
+

Path to rootpassed: 0 / pending: 0 / failed: 1 / total: 1

+ + + + + + + + + + + + + + + +
Path to rootpassed: 0 / pending: 0 / failed: 1 / total: 1
path to rootFailure
+
+

Path to root

+
+

path to root

+ + + + + + + + + + + + + +
ResultExpected Result
+

XPath /element() from:

+
<m:alternative xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+   <m:path>/j:map/</m:path>
+</m:alternative>
+
+
'/j:map'
+
+
+
+
+
+

Nominal document elementpassed: 0 / pending: 0 / failed: 1 / total: 1

+ + + + + + + + + + + + + + + +
Nominal document elementpassed: 0 / pending: 0 / failed: 1 / total: 1
the definition map indicates two possible objects at the rootFailure
+
+

Nominal document element

+
+

the definition map indicates two possible objects at the root

+ + + + + + + + + + + + + +
ResultExpected Result
+

XPath /element() from:

+
<m:alternative xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+   <m:path>/j:map/<split xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">(<step>
+            <axis />
+            <node>
+               <cast>j:map[@key='EVERYTHING']</cast>
+            </node>
+         </step> | <step>
+            <axis />
+            <node>
+               <cast>j:map[@key='ASSEMBLY-1ONLY']</cast>
+            </node>
+         </step>)</split>
+   </m:path>
+</m:alternative>
+
+
'/j:map/(j:map[@key=''EVERYTHING''] | j:map[@key=''ASSEMBLY-1ONLY''])'
+
+
+
+
+
+

Absolute path to specified document elementpassed: 0 / pending: 0 / failed: 1 / total: 1

+ + + + + + + + + + + + + + + +
Absolute path to specified document elementpassed: 0 / pending: 0 / failed: 1 / total: 1
definition map indicates two possible rootsFailure
+
+

Absolute path to specified document element

+
+

definition map indicates two possible roots

+ + + + + + + + + + + + + +
ResultExpected Result
+

XPath /element() from:

+
<m:alternative xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+   <m:path>/j:map/<step xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+         <axis />
+         <node>
+            <cast>j:map[@key='EVERYTHING']</cast>
+         </node>
+      </step>
+   </m:path>
+</m:alternative>
+
+
'/j:map/j:map[@key=''EVERYTHING'']'
+
+
+
+
+
+

A path to a node not described in the definition mappassed: 0 / pending: 0 / failed: 1 / total: 1

+ + + + + + + + + + + + + + + +
A path to a node not described in the definition mappassed: 0 / pending: 0 / failed: 1 / total: 1
produces a no-op (path to nothing)Failure
+
+

A path to a node not described in the definition map

+
+

produces a no-op (path to nothing)

+ + + + + + + + + + + + + +
ResultExpected Result
+

XPath /element() from:

+
<m:alternative xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+   <m:path>/j:map/<nope xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">((: NOWHERE :))</nope>
+   </m:path>
+</m:alternative>
+
+
'/j:map/()'
+
+
+
+
+
+

Absolute path to document element, with predicatepassed: 0 / pending: 0 / failed: 1 / total: 1

+ + + + + + + + + + + + + + + +
Absolute path to document element, with predicatepassed: 0 / pending: 0 / failed: 1 / total: 1
logical predicates are preservedFailure
+
+

Absolute path to document element, with predicate

+
+

logical predicates are preserved

+ + + + + + + + + + + + + +
ResultExpected Result
+

XPath /element() from:

+
<m:alternative xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+   <m:path>/j:map/<step xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
+         <axis />
+         <node>
+            <cast>j:map[@key='EVERYTHING']</cast>
+         </node>
+         <m:filter>[<m:function>true()</m:function>]</m:filter>
+      </step>
+   </m:path>
+</m:alternative>
+
+
'/j:map/j:map[@key=''EVERYTHING''][true()]'
+
+
+
+
+ + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/metapath/metapath-jsonizing.xspec b/toolchains/xslt-proto-v04/metapath/metapath-jsonizing.xspec new file mode 100644 index 000000000..ecb39de8a --- /dev/null +++ b/toolchains/xslt-proto-v04/metapath/metapath-jsonizing.xspec @@ -0,0 +1,70 @@ + + + + + + / + + + + + + + /* + + + + + + + /EVERYTHING + + + + + + + /nothing + + + + + + + /EVERYTHING[true()] + + + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/bogus.json b/toolchains/xslt-proto-v04/testing/bogus.json new file mode 100644 index 000000000..d99091a69 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/bogus.json @@ -0,0 +1,2 @@ +{ "ASSEMBLY-1ONLY": {} +} \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/metaschema-annotate.xsl b/toolchains/xslt-proto-v04/testing/metaschema-annotate.xsl new file mode 100644 index 000000000..328e6025f --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/metaschema-annotate.xsl @@ -0,0 +1,21 @@ + + + + + + + + { upper-case(../@name) } + + + + { replace(name(..),'.*-','') } { ../@name } + + + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/models_definition-map.xml b/toolchains/xslt-proto-v04/testing/models_definition-map.xml new file mode 100644 index 000000000..b86ff837d --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/models_definition-map.xml @@ -0,0 +1,213 @@ + + NIST Metaschema Everything + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/models_metaschema_JSON-SCHEMA.json b/toolchains/xslt-proto-v04/testing/models_metaschema_JSON-SCHEMA.json new file mode 100644 index 000000000..fbe5d2f03 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/models_metaschema_JSON-SCHEMA.json @@ -0,0 +1,255 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/metaschema/ns/everything-schema.json", + "$comment" : "NIST Metaschema Everything: JSON Schema", + "type" : "object", + "definitions" : + { "EVERYTHING" : + { "title" : "EVERYTHING", + "description" : "assembly everything", + "type" : "object", + "properties" : + { "id" : + { "title" : "ID", + "description" : "flag id", + "type" : "string" }, + "field-1only" : + { "$ref" : "#/definitions/field-1only" }, + "field-base64" : + { "$ref" : "#/definitions/field-base64" }, + "field-boolean" : + { "$ref" : "#/definitions/field-boolean" }, + "field-named-value" : + { "$ref" : "#/definitions/field-named-value" }, + "markup-line" : + { "$ref" : "#/definitions/markup-line" }, + "groupable-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/field-groupable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/field-groupable" } } ] }, + "wrapped-fields" : + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/field-wrappable" } }, + "keyed-fields" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "$ref" : "#/definitions/field-by-key" } ] } }, + "dynamic-value-key-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/field-dynamic-value-key" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/field-dynamic-value-key" } } ] }, + "wrapped-prose" : + { "$ref" : "#/definitions/wrapped-prose" }, + "loose-prose" : + { "$ref" : "#/definitions/loose-prose" }, + "ASSEMBLY-1ONLY" : + { "$ref" : "#/definitions/ASSEMBLY-1ONLY" }, + "groupable-assemblies" : + { "anyOf" : + [ + { "$ref" : "#/definitions/assembly-groupable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/assembly-groupable" } } ] }, + "wrapped-assemblies" : + { "anyOf" : + [ + { "$ref" : "#/definitions/assembly-wrappable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/assembly-wrappable" } } ] }, + "keyed-assemblies" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "$ref" : "#/definitions/assembly-by-key" } ] } }, + "everything-recursive" : + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/EVERYTHING" } } }, + "additionalProperties" : false }, + "field-1only" : + { "title" : "FIELD-1ONLY", + "description" : "field field-1only", + "type" : "string" }, + "field-base64" : + { "title" : "FIELD-BASE64", + "description" : "field field-base64", + "type" : "string" }, + "field-boolean" : + { "title" : "FIELD-BOOLEAN", + "description" : "field field-boolean", + "type" : "boolean" }, + "field-groupable" : + { "title" : "FIELD-GROUPABLE", + "description" : "field field-groupable", + "type" : "string" }, + "field-wrappable" : + { "title" : "FIELD-WRAPPABLE", + "description" : "field field-wrappable", + "type" : "string" }, + "field-by-key" : + { "title" : "FIELD-BY-KEY", + "description" : "field field-by-key", + "type" : "object", + "properties" : + { "STRVALUE" : + { "type" : "string" } }, + "required" : + [ "STRVALUE" ], + "additionalProperties" : false }, + "field-named-value" : + { "title" : "FIELD-NAMED-VALUE", + "description" : "field field-named-value", + "type" : "object", + "properties" : + { "id" : + { "title" : "ID", + "description" : "flag id", + "type" : "string" }, + "CUSTOM-VALUE-KEY" : + { "type" : "string" } }, + "required" : + [ "CUSTOM-VALUE-KEY", + "id" ], + "additionalProperties" : false }, + "field-dynamic-value-key" : + { "title" : "FIELD-DYNAMIC-VALUE-KEY", + "description" : "field field-dynamic-value-key", + "type" : "object", + "properties" : + { "color" : + { "title" : "COLOR", + "description" : "flag color", + "type" : "string" } }, + "minProperties" : 1, + "maxProperties" : 2 }, + "markup-line" : + { "title" : "MARKUP-LINE", + "description" : "field markup-line", + "type" : "string" }, + "wrapped-prose" : + { "title" : "WRAPPED-PROSE", + "description" : "field wrapped-prose", + "type" : "string" }, + "loose-prose" : + { "title" : "LOOSE-PROSE", + "description" : "field loose-prose", + "type" : "string" }, + "ASSEMBLY-1ONLY" : + { "title" : "ASSEMBLY-1ONLY", + "description" : "assembly assembly-1only", + "type" : "object", + "properties" : + { "field-1only" : + { "$ref" : "#/definitions/field-1only" }, + "ASSEMBLY-1ONLY" : + { "$ref" : "#/definitions/ASSEMBLY-1ONLY" } }, + "additionalProperties" : false }, + "assembly-groupable" : + { "title" : "ASSEMBLY-GROUPABLE", + "description" : "assembly assembly-groupable", + "type" : "object", + "properties" : + { "groupable-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/field-groupable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/field-groupable" } } ] }, + "groupable-assemblies" : + { "anyOf" : + [ + { "$ref" : "#/definitions/assembly-groupable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/assembly-groupable" } } ] } }, + "additionalProperties" : false }, + "assembly-wrappable" : + { "title" : "ASSEMBLY-WRAPPABLE", + "description" : "assembly assembly-wrappable", + "type" : "object", + "properties" : + { "wrapped-fields" : + { "anyOf" : + [ + { "$ref" : "#/definitions/field-wrappable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/field-wrappable" } } ] }, + "wrapped-assemblies" : + { "anyOf" : + [ + { "$ref" : "#/definitions/assembly-wrappable" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/assembly-wrappable" } } ] } }, + "additionalProperties" : false }, + "assembly-by-key" : + { "title" : "ASSEMBLY-BY-KEY", + "description" : "assembly assembly-by-key", + "type" : "object", + "properties" : + { "keyed-fields" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "$ref" : "#/definitions/field-by-key" } ] } }, + "keyed-assemblies" : + { "type" : "object", + "minProperties" : 1, + "additionalProperties" : + { "allOf" : + [ + { "$ref" : "#/definitions/assembly-by-key" } ] } } }, + "additionalProperties" : false } }, + "oneOf" : + [ + { "properties" : + { "EVERYTHING" : + { "$ref" : "#/definitions/EVERYTHING" } }, + "required" : + [ "EVERYTHING" ], + "additionalProperties" : false, + "maxProperties" : 1 }, + + { "properties" : + { "ASSEMBLY-1ONLY" : + { "$ref" : "#/definitions/ASSEMBLY-1ONLY" } }, + "required" : + [ "ASSEMBLY-1ONLY" ], + "additionalProperties" : false, + "maxProperties" : 1 } ] } \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/models_metaschema_METATRON.sch b/toolchains/xslt-proto-v04/testing/models_metaschema_METATRON.sch new file mode 100644 index 000000000..d1fae26e6 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/models_metaschema_METATRON.sch @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/models_metaschema_XML-SCHEMA.xsd b/toolchains/xslt-proto-v04/testing/models_metaschema_XML-SCHEMA.xsd new file mode 100644 index 000000000..0b6417be9 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/models_metaschema_XML-SCHEMA.xsd @@ -0,0 +1,621 @@ + + + + + NIST Metaschema Everything + 1.0 + everything + +

A mini metaschema produced for conversion testing purposes.

+

This metaschema exercises modeling with global definitions. It does not exercise datatypes, constraints, or cardinality except as reflected in models (where grouping must be explicit).

+

When this is stable and working, extend to include local definitions.

+

Also cover use-name as appropriate.

+
+ EVERYTHING + ASSEMBLY-1ONLY +
+
+ + + + + EVERYTHING + assembly everything + + + EVERYTHING: assembly everything + + + + + + + + + + + + + + + + + + + + + WRAPPED-PROSE + field wrapped-prose + + + WRAPPED-PROSE: field wrapped-prose + + + + + + + + + + + + + + + + + + + + + + ID + flag id + + + ID: flag id + + + + + + + FIELD-1ONLY + field field-1only + + + FIELD-1ONLY: field field-1only + + + + + + + + + FIELD-BASE64 + field field-base64 + + + FIELD-BASE64: field field-base64 + + + + + + + + + FIELD-BOOLEAN + field field-boolean + + + FIELD-BOOLEAN: field field-boolean + + + + + + + + + FIELD-GROUPABLE + field field-groupable + + + FIELD-GROUPABLE: field field-groupable + + + + + + + + + FIELD-WRAPPABLE + field field-wrappable + + + FIELD-WRAPPABLE: field field-wrappable + + + + + + + + + FIELD-BY-KEY + field field-by-key + + + FIELD-BY-KEY: field field-by-key + + + + + + + ID + flag id + + + ID: flag id + + + + + + + + + FIELD-NAMED-VALUE + field field-named-value + + + FIELD-NAMED-VALUE: field field-named-value + + + + + + + ID + flag id + + + ID: flag id + + + + + + + + + FIELD-DYNAMIC-VALUE-KEY + field field-dynamic-value-key + + + FIELD-DYNAMIC-VALUE-KEY: field field-dynamic-value-key + + + + + + + ID + flag id + + + ID: flag id + + + + + + COLOR + flag color + + + COLOR: flag color + + + + + + + + + + + + + ASSEMBLY-1ONLY + assembly assembly-1only + + + ASSEMBLY-1ONLY: assembly assembly-1only + + + + + + + + + + ASSEMBLY-GROUPABLE + assembly assembly-groupable + + + ASSEMBLY-GROUPABLE: assembly assembly-groupable + + + + + + + + + + ASSEMBLY-WRAPPABLE + assembly assembly-wrappable + + + ASSEMBLY-WRAPPABLE: assembly assembly-wrappable + + + + + + + + + + + + + + + + + + + + + + ASSEMBLY-BY-KEY + assembly assembly-by-key + + + ASSEMBLY-BY-KEY: assembly assembly-by-key + + + + + + + + + ID + flag id + + + ID: flag id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/toolchains/xslt-proto-v04/testing/testdata-json-result.xml b/toolchains/xslt-proto-v04/testing/testdata-json-result.xml new file mode 100644 index 000000000..82d75e022 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/testdata-json-result.xml @@ -0,0 +1,100 @@ + + + FIELD-1-ONLY + 1234abcd + true + + fnv1 + FIELD-NAMED-VALUE + + Here's some *markup*: make of it **what you will**! Even if it has ... \* funky characters \` ... and even an ![some picture](img.jpg) + + field-wrappable 1 + field-wrappable 2 + field-wrappable 3 + + + field-by-key 1 + field-by-key 2 + field-by-key 3 + + + + field-dynamic-value-key 1 + + + field-dynamic-value-key 2 + + + field-dynamic-value-key 3 + + + +# Wrapped up prose + +This is prose. All wrapped up. + +# Unwrapped prose + +Here we have unwrapped prose.... + + ASSEMBLY-1-ONLY / FIELD-1-ONLY + + + + + + + + + + assembly-wrappable 1 / field-wrappable 1 + assembly-wrappable 1 / field-wrappable 2 + assembly-wrappable 1 / field-wrappable 3 + + + + + assembly-wrappable 2 / field-wrappable 1 + assembly-wrappable 2 / field-wrappable 2 + assembly-wrappable 2 / field-wrappable 3 + + + + + assembly-wrappable 3 / field-wrappable 1 + assembly-wrappable 3 / field-wrappable 2 + assembly-wrappable 3 / field-wrappable 3 + + + + + + + assembly-by-key 1 / field-by-key 1 + assembly-by-key 1 / field-by-key 2 + assembly-by-key 1 / field-by-key 3 + + + + + assembly-by-key 1 / field-by-key 1 + assembly-by-key 1 / field-by-key 2 + assembly-by-key 1 / field-by-key 3 + + + + + assembly-by-key 1 / field-by-key 1 + assembly-by-key 1 / field-by-key 2 + assembly-by-key 1 / field-by-key 3 + + + + + + nested FIELD-1-ONLY + + + + diff --git a/toolchains/xslt-proto-v04/testing/testdata-supermodel.xml b/toolchains/xslt-proto-v04/testing/testdata-supermodel.xml new file mode 100644 index 000000000..d89928c2a --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/testdata-supermodel.xml @@ -0,0 +1,258 @@ + + + FIELD-1-ONLY + + + 1234abcd + + + true + + + fnv1 + FIELD-NAMED-VALUE + + + Here's some markup: make of it what you will! Even if it has ... * funky characters ` ... and even an some picture + + + + + field-wrappable 1 + + + field-wrappable 2 + + + field-wrappable 3 + + + + + fbk1 + field-by-key 1 + + + fbk2 + field-by-key 2 + + + fbk3 + field-by-key 3 + + + + + fdvk1 + field-dynamic-value-key 1 + + + fdvk2 + field-dynamic-value-key 2 + + + fdvk3 + field-dynamic-value-key 3 + + + + +

Wrapped up prose

+

This is prose. All wrapped up.

+
+
+ + +

Unwrapped prose

+

Here we have unwrapped prose....

+
+
+ + + ASSEMBLY-1-ONLY / FIELD-1-ONLY + + + + + + + + + + + + assembly-wrappable 1 / field-wrappable 1 + + + assembly-wrappable 1 / field-wrappable 2 + + + assembly-wrappable 1 / field-wrappable 3 + + + + + + + assembly-wrappable 2 / field-wrappable 1 + + + assembly-wrappable 2 / field-wrappable 2 + + + assembly-wrappable 2 / field-wrappable 3 + + + + + + + assembly-wrappable 3 / field-wrappable 1 + + + assembly-wrappable 3 / field-wrappable 2 + + + assembly-wrappable 3 / field-wrappable 3 + + + + + + + abk1 + + + abk1.fbk1 + assembly-by-key 1 / field-by-key 1 + + + abk1.fbk2 + assembly-by-key 1 / field-by-key 2 + + + abk1.fbk3 + assembly-by-key 1 / field-by-key 3 + + + + + abk2 + + + abk2.fbk1 + assembly-by-key 1 / field-by-key 1 + + + abk2.fbk2 + assembly-by-key 1 / field-by-key 2 + + + abk2.fbk3 + assembly-by-key 1 / field-by-key 3 + + + + + abk3 + + + abk3.fbk1 + assembly-by-key 1 / field-by-key 1 + + + abk3.fbk2 + assembly-by-key 1 / field-by-key 2 + + + abk3.fbk3 + assembly-by-key 1 / field-by-key 3 + + + + + + + + nested FIELD-1-ONLY + + + +
diff --git a/toolchains/xslt-proto-v04/testing/testdata-testing.json b/toolchains/xslt-proto-v04/testing/testdata-testing.json new file mode 100644 index 000000000..0a683e35d --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/testdata-testing.json @@ -0,0 +1,80 @@ + + { "EVERYTHING" : + { "field-1only" : "FIELD-1-ONLY", + "field-base64" : "1234abcd", + "field-boolean" : true, + "field-named-value" : + { "id" : "fnv1", + "CUSTOM-VALUE-KEY" : "FIELD-NAMED-VALUE" }, + "markup-line" : "Here's some *markup*: make of it **what you will**! Even if it has ... \\* funky characters \\` ... and even an ![some picture](img.jpg)", + "groupable-fields" : + [ "field-groupable 1", + "field-groupable 2", + "field-groupable 3" ], + "wrapped-fields" : + [ "field-wrappable 1", + "field-wrappable 2", + "field-wrappable 3" ], + "keyed-fields" : + { "fbk1" : "field-by-key 1", + "fbk2" : "field-by-key 2", + "fbk3" : "field-by-key 3" }, + "dynamic-value-key-fields" : + [ + { "fdvk1" : "field-dynamic-value-key 1" }, + + { "fdvk2" : "field-dynamic-value-key 2" }, + + { "fdvk3" : "field-dynamic-value-key 3" } ], + "wrapped-prose" : "\n# Wrapped up prose\n\nThis is prose. All wrapped up.", + "loose-prose" : "\n# Unwrapped prose\n\nHere we have unwrapped prose....", + "assembly-1only" : + { "field-1only" : "ASSEMBLY-1-ONLY / FIELD-1-ONLY" }, + "groupable-assemblies" : + [ + { "groupable-fields" : + [ "assembly-groupable 1 / field-groupable 1", + "assembly-groupable 1 / field-groupable 2", + "assembly-groupable 1 / field-groupable 3" ] }, + + { "groupable-fields" : + [ "assembly-groupable 2 / field-groupable 1", + "assembly-groupable 2 / field-groupable 2", + "assembly-groupable 2 / field-groupable 3" ] }, + + { "groupable-fields" : + [ "assembly-groupable 3 / field-groupable 1", + "assembly-groupable 3 / field-groupable 2", + "assembly-groupable 3 / field-groupable 3" ] } ], + "wrapped-assemblies" : + [ + { "wrapped-fields" : + [ "assembly-wrappable 1 / field-wrappable 1", + "assembly-wrappable 1 / field-wrappable 2", + "assembly-wrappable 1 / field-wrappable 3" ] }, + + { "wrapped-fields" : + [ "assembly-wrappable 2 / field-wrappable 1", + "assembly-wrappable 2 / field-wrappable 2", + "assembly-wrappable 2 / field-wrappable 3" ] }, + + { "wrapped-fields" : + [ "assembly-wrappable 3 / field-wrappable 1", + "assembly-wrappable 3 / field-wrappable 2", + "assembly-wrappable 3 / field-wrappable 3" ] } ], + "keyed-assemblies" : + { "abk1" : + { "keyed-fields" : + { "abk1.fbk1" : "assembly-by-key 1 / field-by-key 1", + "abk1.fbk2" : "assembly-by-key 1 / field-by-key 2", + "abk1.fbk3" : "assembly-by-key 1 / field-by-key 3" } }, + "abk2" : + { "keyed-fields" : + { "abk2.fbk1" : "assembly-by-key 1 / field-by-key 1", + "abk2.fbk2" : "assembly-by-key 1 / field-by-key 2", + "abk2.fbk3" : "assembly-by-key 1 / field-by-key 3" } }, + "abk3" : + { "keyed-fields" : + { "abk3.fbk1" : "assembly-by-key 1 / field-by-key 1", + "abk3.fbk2" : "assembly-by-key 1 / field-by-key 2", + "abk3.fbk3" : "assembly-by-key 1 / field-by-key 3" } } } } } \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/tiny.xml b/toolchains/xslt-proto-v04/testing/tiny.xml new file mode 100644 index 000000000..b2f0da9ba --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny.xml @@ -0,0 +1,11 @@ + + + Here is a string + true + + Here a string is + false + + \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/tiny_definition-map.xml b/toolchains/xslt-proto-v04/testing/tiny_definition-map.xml new file mode 100644 index 000000000..f5a972691 --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny_definition-map.xml @@ -0,0 +1,34 @@ + + NIST Tiny Testing Metaschema + 0.1 + + + + + + + + + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/tiny_metaschema_JSON-SCHEMA.json b/toolchains/xslt-proto-v04/testing/tiny_metaschema_JSON-SCHEMA.json new file mode 100644 index 000000000..d8579bb2d --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny_metaschema_JSON-SCHEMA.json @@ -0,0 +1,50 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/metaschema/ns/tiny-schema.json", + "$comment" : "NIST Tiny Testing Metaschema: JSON Schema", + "type" : "object", + "definitions" : + { "TINY" : + { "title" : "Tiny stuff", + "description" : "Tiny, but hard", + "type" : "object", + "properties" : + { "id-flag" : + { "title" : "ID FLAG", + "description" : "For identification", + "type" : "string" }, + "string-field" : + { "$ref" : "#/definitions/string-field" }, + "object-field" : + { "$ref" : "#/definitions/object-field" }, + "more-tiny" : + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/TINY" } } }, + "additionalProperties" : false }, + "string-field" : + { "title" : "STRING FIELD", + "description" : "Will be only a string", + "type" : "string" }, + "object-field" : + { "title" : "OBJECT FIELD", + "description" : "With a flag, will be an object", + "type" : "object", + "properties" : + { "id-flag" : + { "title" : "ID FLAG", + "description" : "For identification", + "type" : "string" }, + "boolean-value" : + { "type" : "string" } }, + "required" : + [ "boolean-value" ], + "additionalProperties" : false } }, + "properties" : + { "TINY" : + { "$ref" : "#/definitions/TINY" } }, + "required" : + [ "TINY" ], + "additionalProperties" : false, + "maxProperties" : 1 } \ No newline at end of file diff --git a/toolchains/xslt-proto-v04/testing/tiny_metaschema_METATRON.sch b/toolchains/xslt-proto-v04/testing/tiny_metaschema_METATRON.sch new file mode 100644 index 000000000..08975d0db --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny_metaschema_METATRON.sch @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/tiny_metaschema_XML-SCHEMA.xsd b/toolchains/xslt-proto-v04/testing/tiny_metaschema_XML-SCHEMA.xsd new file mode 100644 index 000000000..0a45bc50c --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny_metaschema_XML-SCHEMA.xsd @@ -0,0 +1,89 @@ + + + + + NIST Tiny Testing Metaschema + 0.1 + t + TINY + + + + + + + Tiny stuff + Tiny, but hard + + + Tiny stuff: Tiny, but hard + + + + + + + + + + ID FLAG + For identification + + + ID FLAG: For identification + + + + + + + STRING FIELD + Will be only a string + + + STRING FIELD: Will be only a string + + + + + + + + + OBJECT FIELD + With a flag, will be an object + + + OBJECT FIELD: With a flag, will be an object + + + + + + + ID FLAG + For identification + + + ID FLAG: For identification + + + + + + diff --git a/toolchains/xslt-proto-v04/testing/tiny_xml-to-supermodel.xsl b/toolchains/xslt-proto-v04/testing/tiny_xml-to-supermodel.xsl new file mode 100644 index 000000000..0e06dc99c --- /dev/null +++ b/toolchains/xslt-proto-v04/testing/tiny_xml-to-supermodel.xsl @@ -0,0 +1,56 @@ + + + + + + + + + http://csrc.nist.gov/metaschema/ns/tiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +