From 7e0377362d8194f4ad3d25ada8270c46d0223995 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Thu, 14 Jul 2022 15:48:02 -0400 Subject: [PATCH] Metaschema / XSLT implementation alignment (#197) * Relocate schema resources (#191) - Moved schema resources out of XSLT implementation - Relocated XSD and datatype XML schemas. Removed junk and generated files. Many datatype adjustments - Tweeks to schema data types to address unicode issues. Resolves usnistgov/OSCAL#1127. Resolves usnistgov/OSCAL#956. - Adjusted type names of Metaschema types to be purely hyphenated. - Removed extra character ranges that are causing C# problems. Resolves usnistgov/OSCAL#1127. - Adjusted URI data type names to be more consistent between XML and JSON. Many metaschema.xsd adjustments - Alignment of data types used with new Metschema datatype names. - Additional repairs of tests, including naming consistency. - adding new unit test for a valid json-value key using a label - many fixes to broken tests - Removed duplicate uuid test scenario. - Many fixes to make unit test Metaschemas valid. - Added JSON schema schema. - Some schema generation refactoring to support new data-driven test harness. * Fixed URI of choice unit test. * Update metaschema-datatypes.xsd Adjusting whitespace handling for URI types. * adding leading and trailing whitespace checks to all XML schema datatype derived types * Adjustments to debug charstrings. * Update metaschema-datatypes.json Minor adjustments to data types for comments on #1260. * refactored metaschema schema to support external constraint definitions * Added constraint extensibility configuration. * added formal-name and description to definition references * XSLT M4 Metaschema pipeline updates (#214) * Composition unit tests now valid to updated schemas; added (missing) tests. * Adding XSpec for schema generation; nominal schema target examples * Adding XSpec tests (testing schema generation as transforms) and initial set of targets for testing * Major reorganization and archiving (some temporary, prior to defenestration); new tests; readme documents in each folder for schema-generation unit tests to help trace efforts * More details in json-value-key readme; updated top-level JSON schema generation xspec * Metaschema Schematron rule intercepting a json-key setting with no BY_KEY in the grouping logic * Cleaned up extra JSON Schema file * Updated metaschema model wrt json-key, json-value-key flag-ref (no longer flag-name); other Metaschema touchups * Rewiring and simplifying XSD production pipeline with datatypes now acquired from the normative metaschema /schema subdirectory - removed the namespace fixup step, no longer needed. * Updated anthology ('menagerie') metaschema example, with cleanup * In XSD generation, now emitting datatype definitions only for datatypes actually needed by a schema * Updating schema TODO notes on synching unit tests; bit of cleanup * Addressing #212 - XML to JSON converter no longer chokes on edge cases (array items of SINGLETON_OR_ARRAY groups) * Updating top-level composition unit tests * .gitignore covering HTML reports from test runs * Removing outdated testing results * Adding back support for old datatype names as indicated in metaschema.xsd (cf line 1252) * Restoring deprecated datatypes per #195 * Bit of cleanup; utility maintenance * Removing 'INFO' level comment in XSD * Tweakage to align XSD out (dropping comment; cleaning up namespaces) * Patching hole in JSON datatype assignment also * Emitting cleaner namespaces in XSD; slight refactoring of JSON Schema * Adjusting JSON Schema type definitions to produce valid constraints over Metaschema atomic types * Extending atomic data type acquisition to collect one level of indirect references * Cleaning up obsolete datatype support * Bit more cleanup; updated readme * Adjusting handling of warnings and exception messages in pipelines * Removing outdated artifacts from schema generation unit testing.md Co-authored-by: Wendell Piez --- schema/json/metaschema-datatypes.json | 114 ++ schema/xml/metaschema-datatypes.xsd | 241 ++++ schema/xml/metaschema-markup-line.xsd | 11 + schema/xml/metaschema-markup-multiline.xsd | 102 ++ schema/xml/metaschema-prose-base.xsd | 76 ++ schema/xml/metaschema-prose-module.xsd | 5 + schema/xml/metaschema.xsd | 1157 ++++++++++++++++++++ 7 files changed, 1706 insertions(+) create mode 100644 schema/json/metaschema-datatypes.json create mode 100644 schema/xml/metaschema-datatypes.xsd create mode 100644 schema/xml/metaschema-markup-line.xsd create mode 100644 schema/xml/metaschema-markup-multiline.xsd create mode 100644 schema/xml/metaschema-prose-base.xsd create mode 100644 schema/xml/metaschema-prose-module.xsd create mode 100644 schema/xml/metaschema.xsd diff --git a/schema/json/metaschema-datatypes.json b/schema/json/metaschema-datatypes.json new file mode 100644 index 000000000..180f86333 --- /dev/null +++ b/schema/json/metaschema-datatypes.json @@ -0,0 +1,114 @@ +{ + "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/oscal/1.0/metaschema-datatypes-schema.json", + "$comment" : "OSCAL Unified Model of Models", + "type" : "object", + "definitions" : { + "Base64Datatype": { + "type": "string", + "pattern": "^[0-9A-Fa-f]+$", + "contentEncoding": "base64" + }, + "BooleanDatatype": { + "type": "boolean" + }, + "DateDatatype": { + "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})?$" + }, + "DateWithTimezoneDatatype": { + "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})$" + }, + "DateTimeDatatype": { + "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)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})?$" + }, + "DateTimeWithTimezoneDatatype": { + "type": "string", + "format": "date-time", + "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)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "DayTimeDurationDatatype": { + "type": "string", + "format": "duration", + "pattern": "^[-+]?P([-+]?[0-9]+D)?(T([-+]?[0-9]+H)?([-+]?[0-9]+M)?([-+]?[0-9]+([.,][0-9]{0,9})?S)?)?$" + }, + "DecimalDatatype": { + "type": "number", + "pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$" + }, + "EmailAddressDatatype": { + "type": "string", + "format": "email", + "pattern": "^.+@.+$" + }, + "HostnameDatatype": { + "allOf": [ + {"$ref": "#/definitions/StringDatatype"}, + {"format": "idn-hostname"} + ] + }, + "IntegerDatatype": { + "type": "integer" + }, + "IPV4AddressDatatype": { + "type": "string", + "format": "ipv4", + "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$" + }, + "IPV6AddressDatatype": { + "type": "string", + "format": "ipv6", + "pattern": "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$" + }, + "MarkupLineDatatype": { + "type": "string", + "pattern": "^[^\n]+$" + }, + "MarkupMultilineDatatype": { + "type": "string" + }, + "NonNegativeIntegerDatatype": { + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + {"minimum": 0, + "type": "number"} + ] + }, + "PositiveIntegerDatatype": { + "allOf": [ + {"$ref": "#/definitions/IntegerDatatype"}, + {"minimum": 1, + "type": "number"} + ] + }, + "StringDatatype": { + "type": "string", + "pattern": "^\\S(.*\\S)?$" + }, + "TokenDatatype": { + "type": "string", + "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" + }, + "URIDatatype": { + "type": "string", + "format": "uri", + "pattern": "^[a-zA-Z][a-zA-Z0-9+\\-.]+:.+$" + }, + "URIReferenceDatatype": { + "type": "string", + "format": "uri-reference" + }, + "UUIDDatatype": { + "type": "string", + "description": "A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122.", + "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" + }, + "YearMonthDurationDatatype": { + "type": "string", + "format": "duration", + "pattern": "^[-+]?P([-+]?[0-9]+Y)?([-+]?[0-9]+M)?([-+]?[0-9]+W)?([-+]?[0-9]+D)?$" + } + } +} diff --git a/schema/xml/metaschema-datatypes.xsd b/schema/xml/metaschema-datatypes.xsd new file mode 100644 index 000000000..a1f8e099a --- /dev/null +++ b/schema/xml/metaschema-datatypes.xsd @@ -0,0 +1,241 @@ + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + + + + + The xs:date with a required timezone. + + + + + + + + + + + + + + + The xs:dateTime with a required timezone. + + + + + + + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + An email address + + + + + Need a better pattern. + + + + + + + + A host name + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + 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. + + + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + A string, but not empty and not whitespace-only + (whitespace is U+9, U+10, U+32 or [ \n\t]+ ) + + + + The OSCAL 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + A trimmed string, at least one character with no + leading or trailing whitespace. + + + + + + + + + A string token following the rules of XML "no + colon" names, with no whitespace. (XML names are single alphabetic + characters followed by alphanumeric characters, periods, underscores or dashes.) + + + + + + + + A single token may not contain whitespace. + + + + + + + + + A URI + + + + + Requires a scheme with colon per RFC 3986. + + + + + + + + A URI reference, such as a relative URL + + + + + + A trimmed URI, at least one character with no + leading or trailing whitespace. + + + + + + + + A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC + 4122. + + + + + A sequence of 8-4-4-4-12 hex digits, with extra + constraints in the 13th and 17-18th places for version 4 and 5 + + + + + + + diff --git a/schema/xml/metaschema-markup-line.xsd b/schema/xml/metaschema-markup-line.xsd new file mode 100644 index 000000000..7d8d48bd2 --- /dev/null +++ b/schema/xml/metaschema-markup-line.xsd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/schema/xml/metaschema-markup-multiline.xsd b/schema/xml/metaschema-markup-multiline.xsd new file mode 100644 index 000000000..559a3915f --- /dev/null +++ b/schema/xml/metaschema-markup-multiline.xsd @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The content model is the same as inlineType, but line endings need + to be preserved, since this is preformatted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schema/xml/metaschema-prose-base.xsd b/schema/xml/metaschema-prose-base.xsd new file mode 100644 index 000000000..320daac4b --- /dev/null +++ b/schema/xml/metaschema-prose-base.xsd @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An insert can be used to identify a placeholder for dynamically inserting text related to a specific object, which is referenced by the object's identifier using an id-ref. This insert mechanism allows the selection of which text value from the object to dynamically include based on the application's display requirements. + + + + The type of object to include from (e.g., parameter, control, component, role, etc.) + + + + + The identity of the object to insert a value for. The identity will be selected from the index of objects of the specified type. The specific value to include is based on the application's display requirements, which will likely use a specific data element associated with the type (e.g., title, identifier, value, etc.) that is appropriate for the application. + + + + + + + diff --git a/schema/xml/metaschema-prose-module.xsd b/schema/xml/metaschema-prose-module.xsd new file mode 100644 index 000000000..e653c0537 --- /dev/null +++ b/schema/xml/metaschema-prose-module.xsd @@ -0,0 +1,5 @@ + + + + + diff --git a/schema/xml/metaschema.xsd b/schema/xml/metaschema.xsd new file mode 100644 index 000000000..d6dc6bc06 --- /dev/null +++ b/schema/xml/metaschema.xsd @@ -0,0 +1,1157 @@ + + + + + + This prose module provides support for line and multiline markup. + + + + + + This datatypes module provides support for all other built-in Metaschema data types. + + + + + + + + Root element of an OSCAL Metaschema definition. Defines a family of data + structures representing a model. + + + + + + The name of the information model represented by this Metaschema definition. + + + + + + + The namespace for the collection of Metaschema models this Metaschema definition + belongs to. Also 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. This value is not reflected in + OSCAL JSON. + + + + + + + + To import a set of Metaschema definitions from an out-of-line resource, supporting reuse of common information structures. + + + + + A relative or absolute URI for retrieving an out-of-line Metaschema definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Root element of an OSCAL Metaschema external constraints definition. Defines rules to be applied to an existing set of Metaschema models. + + + + + + The name of this constraint set. + + + + + The version of this constraint set. + + + + + + To import a set of Metaschema constraints from an out-of-line resource, supporting composition of constraint sets. + + + + + A relative or absolute URI for retrieving an out-of-line Metaschema definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The type of all definition and instance names. + + + + + + + An element with structured element content in XML; in JSON, an object with + properties. Defined globally, an assembly can be assigned to appear in the model of any assembly (another assembly type, or itself), by assembly reference. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used inside a field definition, designates a name (key) for the property in JSON containing the field's value. Use of a 'json-value-key' is mutually exclusive with a 'json-value-key-flag'. + + + + + + Used inside a field definition, designates a flag whose value is to be used as the name (key) for the property in JSON containing the field's value. Use of a 'json-value-key-flag' is mutally exclusive with a 'json-value-key'. + + + + + + + In JSON, an object with a nominal string value (potentially with internal + inline - not fully structured - markup). In XML, an element with string or markup + content. Defined globally, a field can be assigned to appear in the model of any assembly by field reference. + + + + + + + + + + + + + + + + + + + + + + + + + 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. Defined globally, a flag can be assigned to any field or assembly by flag reference. + + + + + + + + + + + + + + + + + + In JSON, an object with a nominal string value (potentially with internal + inline - not fully structured - markup). In XML, an element with string or markup + content. A local definition describes and constrains the appearance of the field only in this (assembly) context. + + + + + + + + + + + + + + + + + + + + + + + + + In JSON, an object with a nominal string value (potentially with internal + inline - not fully structured - markup). In XML, an element with string or markup + content. A local definition describes and constrains the appearance of the field only in this (assembly) context. + + + + + + + + + + + + + + + + + + + + + + A field with assigned datatype 'markup-multiline' may be designated for representation with or without a containing (wrapper) element + in XML. + + + + + + + + A data point to be expressed as an attribute in the XML or a name/value pair in the JSON. A local definition describes and constrains the appearance of the flag only in its parent (assembly or field) context. + + + + + + + + + + + + + + + + + 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 JSON Base URI is nominal base URI assigned to a JSON Schema instance expressing the model defined by this metaschema. + + + + + + + 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 remark applies to only XML representations. + + + + + The remark applies to only JSON and YAML representations. + + + + + + + + + + + + A version string used to distinguish between multiple revisions of the same resource. + + + + + + + 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. + + + + + + + Referencing an assembly definition to include an assembly or assemblies of a given type in a model. + + + + + + + + + + + + + + + Referencing a field definition to include a field or fields of a given type in a model. + + + + + + + + + + + + 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. + + + + + + + + + Minimum occurrence of assemblies or fields within a valid model. The default value is 0, for an optional occurrence. + + + + + Maximum occurrence of assemblies or fields within a valid model. The default value is 1, for a single occurrence. 'unbounded' permits any number of assemblies of the designated type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A violation of the constraint represents a serious fault in the content + that will prevent typical use of the content. + + + + + A violation of the constraint represents a fault in the content. This + may include issues around compatibility, integrity, consistency, etc. + + + + + A violation of the constraint represents a potential issue + with the content. + + + + + A violation of the constraint represents a point of + interest. + + + + + + + + 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) + + + + + Determines if the given enumerated value or values within a namespace may be extended by other allowed value constraints. + + + + + + + + + + + Can be extended by constraints within the same model. + + + + + Can be extended by external constraints. + + + + + Cannot be extended. + + + + + + + + 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. + + + + + + + + + + The associated construct has been deprecated at the specified version. Its use should be avoided if possible. + + + + + + + + + + + + + + + + + A regex subset that is conformant to both https://www.w3.org/TR/xmlschema11-2/#regexes and https://www.ecma-international.org/ecma-262/11.0/index.html#sec-patterns. + + + + + + + + + + + + + + + + + + + Specifies the datatype for which the value identified by the scope + attribute must conform to. + + + + + + + + + + + + Specifies the target of the constraint as a metaschema path. If the value is "." and the containing metaschema object is a field, the constraint applies to the field's value. Otherwise, the scope value "." is not allowed to be used. + + + + + + + + + + + + + Specifies the target of the constraint as a metaschema path. If the value is "." and the containing metaschema object is a field, the constraint applies to the field's value. + + + + + + + + + + + + Constrains the allowed values for the flag. + + + + + Constrains the allowed values based on the provided regex pattern. + + + + + Checks that the specified key-field values match a key in the index with the specified name. + + + + + Checks that the specified test returns true in this evaluation context. + + + + + + + + + + + + + + + + Specifies the field or flag value that is used to generate the key for a given object that is a member of this index. If more than one key-field is provided, then the key is a composition of the specified key-fields. The ordering of the key-field defined the relative order of the index's key. The field or flag values pointed to must be a field value or a required flag value. + + + + + + + Defines an unique key constraint. + + + + + + + Specifies a value, relative to the provided target, + that is to be used as part of the key. More than one key-field can be used to create + a composite key. + + + + + + + The first captured group in the regular expression is used + as the key value for lookup. The regular expression must not match a + zero-length string. + + + + + + + + + + + + + + + + + + Specifies the value objects to be included in the key constraint, or the object that contains a reference to an item in an index. If the value is ".", then the key is targeting the current metaschema object. + + + + + + + + + + + Defines an index, a check against an index, or a uniqueness constraint. + + + + + + Specifies the name of the index, a reference to an index, or the name of a uniqueness constraint. + + + + + + + + + Defines an index, a check against an index, or a uniqueness constraint. + + + + + + Specifies the value objects to be included in the index constraint, or the object that contains a reference to an item in an index. If the value is ".", then the key is targeting the current metaschema object. + + + + + + + + + + Defines an index, a check against an index, or a uniqueness constraint. + + + + + + Specifies the value objects to be included in the index constraint, or the object that contains a reference to an item in an index. If the value is ".", then the key is targeting the current metaschema object. + + + + + Specifies the name of the index, a reference to an index, or the name of a uniqueness constraint. + + + + + + + + + + + + + + + + A test that is expected to pass in this context. Presently, datatyping + is not directly supported except by explicit use of data type casting functions, e.g. + xs:double() and xs:date(). + + + + + + + + + + + + Specifies the target of the constraint as a metaschema path. If the value is "." and the containing metaschema object is a field or flag, the constraint applies to the value of the field or flag. Otherwise, the scope value "." is not allowed to be used. + + + + + + + + + + + Constrains the allowed values for the flag or field referenced by the scope attribute. + + + + + Constrains the allowed values based on the provided regex pattern or checks that the value is conformant to the specified datatype. + + + + + Checks that the specified key-field values match a key in the index with the specified name. + + + + + Checks that the specified test returns true in this evaluation context. + + + + + + + + + + + + + + Specifies the target of the constraint as a metaschema path. If the + value is "." and the containing metaschema object is a field, the constraint applies + to the field's value. Otherwise, the scope value "." is not allowed to be + used. + + + + + Minimum occurrence of assemblies or fields within the set of objects + identified by the target. This value cannot be less than the + corresponding value defined on the target. + + + + + Maximum occurrence of assemblies or fields within the set of objects + identified by the target. This value must be less than the corresponding + value defined on the target. + + + + + + + + + + + Defines a new named index. Each entry in the index will have a unique key, based on the key-field elements, and an associated object value, based on the target selection.. + + + + + Checks that the specified set of target entries have a key, based on the key-field entries that is unique. The name identifies the name of the uniqueness constraint, which can be used for error reporting, etc. + + + + + Checks that the specified set of target entries match the provided cardinality. + + + + + + + + + + + + + + + + + + + + + + + + + + + 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.. + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + A string with no leading or trailing whitespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This definition is only available in the context of the current metaschema. + + + + + This definition will be made available to any metaschema that includes this one either directly or indirectly through a chain of imported metaschemas. + + + + +