diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac6e0ee9..8314335d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: true + submodules: "recursive" fetch-depth: 0 - uses: actions/setup-java@v3 with: diff --git a/.gitignore b/.gitignore index 3cc589cb..73a1e16d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ # test outputs src/**/test_output/ + +# downloaded miscellaneous + +support/lib/* \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index c3cb9c7f..8b1c4076 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,13 +1,11 @@ -[submodule "support/xspec"] - path = support/xspec - url = https://github.com/xspec/xspec.git [submodule "support/metaschema"] path = support/metaschema url = https://github.com/usnistgov/metaschema.git branch = develop fetchRecurseSubmodules = false +[submodule "support/xslt3-functions"] + path = support/xslt3-functions + url = https://github.com/usnistgov/xslt3-functions.git [submodule "support/schxslt"] path = support/schxslt url = https://github.com/schxslt/schxslt.git -[submodule "metaschema"] - url = https://github.com/usnistgov/metaschema.git diff --git a/README.md b/README.md index d8129dd6..566d47af 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,9 @@ Additionally, we care about, but do not prioritize: Formerly housed in the [Metaschema repository](https://github.com/usnistgov/metaschema), this code base traces the history of development of the Metaschema concept in the context of the OSCAL project. It was originally conceived as a demonstration and proof of concept, providing a bridge enabling JSON- and XML-based development in parallel over common problem sets and common data. Success in this effort led to a determination that multiple implementations of a platform-independent specification were needed, at which point this implementation was carved out into its own repository. -### Project sunset +### Maturity and project sunset + +Software in this repository remains 'experimental' in status until it can be demonstrated with public conformance testing, which in turn depends on the maturity of the Metaschema initiative. The NIST team has no long-term plan to maintain this project outside the context of the initiatives it supports, [OSCAL](https://pages.nist.gov/OSCAL) and [Metaschema](https://pages.nist.gov/metaschema), while we reserve the right to change and adapt to community needs in alignment with NIST's mission. A project goal is to enable the stabilization and socialization of the Metaschema technology, as evidenced by the use and support of *other* Metaschema implementations. diff --git a/TESTING.md b/TESTING.md index 2b2f7b0a..e165cbf2 100644 --- a/TESTING.md +++ b/TESTING.md @@ -40,7 +40,6 @@ Currently we are emulating and re-engineering some specific XSpec capabilities i These efforts are focused on producing and refining XSpec runtimes for various use cases and scenarios with specialized requirements faced by this project, such as arbitrary batching and iXML support. Tools we develop here are released under the same terms as Metaschema-XSLT (as open-source software). - ## Test-driven development Almost all testing in this repository falls into the category of either XSLT transformations, or runtimes that embed transformations. diff --git a/src/Makefile b/src/Makefile index 71cdcad9..8253a313 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,6 +10,10 @@ dirs:=$(shell find '.' ! -wholename ./Makefile -name 'Makefile' -printf "%h\n") test: ## Run all tests $(call FOREACH_MAKE,$@,$(dirs)) +.PHONY: pre-checks +pre-checks: ## Run all "pre checks", enforcing validation contracts across input artifacts + $(call FOREACH_MAKE_OPTIONAL,$@,$(dirs)) + .PHONY: smoke-test smoke-test: ## Run all "smoke tests", establishing a baseline of sanity across the project $(call FOREACH_MAKE_OPTIONAL,$@,$(dirs)) diff --git a/src/common/metaschema-ws-strip.xsl b/src/common/metaschema-ws-strip.xsl new file mode 100644 index 00000000..8896923e --- /dev/null +++ b/src/common/metaschema-ws-strip.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/testing/issue_235_regression-metaschema.xml b/src/converter-gen/issue_235_regression-metaschema.xml similarity index 100% rename from src/testing/issue_235_regression-metaschema.xml rename to src/converter-gen/issue_235_regression-metaschema.xml diff --git a/src/testing/issue_235_regression.xspec b/src/converter-gen/issue_235_regression.xspec similarity index 98% rename from src/testing/issue_235_regression.xspec rename to src/converter-gen/issue_235_regression.xspec index a61e54a9..9f818c69 100644 --- a/src/testing/issue_235_regression.xspec +++ b/src/converter-gen/issue_235_regression.xspec @@ -2,7 +2,9 @@ + stylesheet="xml-to-json/supermodel-to-json.xsl"> + + diff --git a/src/converter-gen/testing/definition-maps/assessment-plan-reduce-map-output.xml b/src/converter-gen/testing/definition-maps/assessment-plan-reduce-map-output.xml new file mode 100644 index 00000000..2d9925bb --- /dev/null +++ b/src/converter-gen/testing/definition-maps/assessment-plan-reduce-map-output.xml @@ -0,0 +1,16671 @@ + + + + OSCAL Assessment Plan Model + 1.0.4 + oscal-ap + http://csrc.nist.gov/ns/oscal/1.0 + http://csrc.nist.gov/ns/oscal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + The link identifies the authoritative location for this file. Defined by RFC 6596. + The link identifies an alternative location or format for this file. Defined by the HTML Living Standard + + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + + + + + + + + + + A Digital Object Identifier (DOI); use is preferred, since this allows for retrieval of a full bibliographic record. + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A home address. + A work address. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A home phone number. + An office phone number. + A mobile phone number. + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + Characterizes the kind of location. + + + A location that contains computing assets. A class can be used to indicate the sub-type of data-center as primary or alternate. + + + The location is a data-center used for normal operations. + The location is a data-center used for fail-over or backup operations. + + + + + + + + + + + An individual. + A group of individuals formed for a specific purpose. + + + + + + + + + + + + + + + The identifier is Open Researcher and Contributor ID (ORCID). + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + A home phone number. + An office phone number. + A mobile phone number. + + + + + + + + + + + + + A home address. + A work address. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A mail stop associated with the party. + The name or number of the party's office. + The formal job title of a person. + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indicates the organization that created this content. + Indicates the organization that prepared this content. + Indicates the organization for which this content was created. + Indicates the organization responsible for all content represented in the "document". + Indicates the organization to contact for questions or support related to this content. + + + The value identifies a comma-seperated listing of keywords associated with this content. These keywords may be used as search terms for indexing and other applications. + + + The link identifies the authoritative location for this file. Defined by RFC 6596. + The link identifies an alternative location or format for this file. Defined by the HTML Living Standard + + This link identifies a resource containing the latest version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + + + + + + + + + + + + + + + + + The system as a whole. + An external system, which may be a leveraged system or the other side of an interconnection. + A connection to something outside this system. + Any software, operating system, or firmware. + A physical device. + A service that may provide APIs. + An enforceable policy. + A tangible asset used to provide physical protections or countermeasures. + A list of steps or actions to take to achieve some end result. + An applicable plan. + Any guideline or recommendation. + Any organizational or industry standard. + An external assessment performed on some other component, that has been validated by a third-party. + A physical or virtual network. + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + The component is being designed, developed, or implemented. + The component is currently operational and is available for use in the system. + The component is no longer operational. + Some other state. + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Transmission Control Protocol + User Datagram Protocol + + + + + + + + It is a best practice to provide a UUID. + + + + + + + + + + Relative placement of component ('internal' or 'external') to the system. + UUID of the related leveraged-authorization assembly in this SSP. + UUID of the component as it was assigned in the leveraged system's SSP. + Simple indication of the asset's function, such as Router, Storage Array, DNS Server. + An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item. + An asset tag assigned by the organization responsible for maintaining the logical or tangible item. + Identifies whether the asset is publicly accessible (yes/no) + Identifies whether the asset is virtualized (yes/no) + Virtual LAN identifier of the asset. + The network identifier of the asset. + A human-readable label for the parent context. + An alternative identifier, whose value is easily sortable among other such values in the document. + The name of the baseline configuration for the asset. + Can the asset be check with an authenticated scan? (yes/no) + The function provided by the asset for the system. + The version of the component. + The specific patch level of the component. + The model of the component. + The date the component was released, such as a software release date or policy publication date. + Used with component-type='validation' to provide a well-known name for a kind of validation. + Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component. + + + A reference to another component that this component has a dependency on. + A reference to another component of component-type=validation, that is a validation (e.g., FIPS 140-2) for this component + A pointer to a validation record (e.g., FIPS 140-2) or other compliance information. + A reference to the baseline template used to configure the asset. + This service is used by the referenced component identifier. + A link to the system security plan of the external system. + This component uses the network provided by the identified network component. + + + Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. + Responsible for administering a set of assets. + Members of the security operations center (SOC). + Members of the network operations center (NOC). + Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. + Responsible for providing information and support to users. + Responsible for the configuration management processes governing changes to the asset. + Responsible for the creation and maintenance of a component. + Organization responsible for providing the component, if this is different from the "maintainer" (e.g., a reseller). + + + System software that manages computer hardware, software resources, and provides common services for computer programs. + An electronic collection of data, or information, that is specially organized for rapid search and retrieval. + A system that delivers content or services to end users over the Internet or an intranet. + A system that resolves domain names to internet protocol (IP) addresses. + A computer system that sends and receives electronic mail messages. + A system that stores, organizes and provides access to directory information in order to unify network resources. + A private branch exchange (PBX) provides a a private telephone switchboard. + A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. + A physical or virtual networking device that forwards data packets between computer networks. + A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device. + A consolidated, block-level data storage capability. + A physical or virtual machine that centralizes hardware, software, or services for a specific purpose. + + + The component allows an authenticated scan. + The component does not allow an authenticated scan. + + + The component is publicly accessible. + The component is not publicly accessible. + + + The component is virtualized. + The component is not virtualized. + + + The component is implemented within the system boundary. + The component is implemented outside the system boundary. + + + + + + + + The name of the company or organization + + + A link to an online information provided by the authorizing body. + + + If a "software" component-type, the identifier, such as a SWID tag, for the software component. + + + This service is provided by the referenced component identifier. + This service is used by the referenced component identifier. + + + + Title of the Interconnection Security Agreement (ISA). + Date of the Interconnection Security Agreement (ISA). + The name of the remote interconnected system. + An Internet Protocol Version 4 interconnection address + An Internet Protocol Version 6 interconnection address + An Internet Protocol Version 6 interconnection address + + + The identified IP address is for this system. + The identified IP address is for the remote system to which this system is connected. + + + A link to the system interconnection agreement. + + + Interconnection Security Agreement (ISA) point of contact (POC) for this system. + Interconnection Security Agreement (ISA) point of contact (POC) for the remote interconnected system. + Interconnection Security Agreement (ISA) authorizing official for this system. + Interconnection Security Agreement (ISA) authorizing official for the remote interconnected system. + + + + + + Data from the remote system flows into this system. + Data from this system flows to the remote system. + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The version of the component. + The specific patch level of the component. + The model of the component. + The date the component was released, such as a software release date or policy publication date. + Used with component-type='validation' to provide a well-known name for a kind of validation. + Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component. + Simple indication of the asset's function, such as Router, Storage Array, DNS Server. + An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item. + An asset tag assigned by the organization responsible for maintaining the logical or tangible item. + Identifies whether the asset is publicly accessible (yes/no) + Identifies whether the asset is virtualized (yes/no) + Virtual LAN identifier of the asset. + The network identifier of the asset. + A human-readable label for the parent context. + An alternative identifier, whose value is easily sortable among other such values in the document. + The name of the baseline configuration for the asset. + Can the asset be check with an authenticated scan? (yes/no) + The function provided by the asset for the system. + + + + Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. + Responsible for administering a set of assets. + Members of the security operations center (SOC). + Members of the network operations center (NOC). + Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. + Responsible for providing information and support to users. + Responsible for the configuration management processes governing changes to the asset. + + + + + + + + + + + + + The Internet Protocol v4 Address of the asset. + The Internet Protocol v6 Address of the asset. + The full-qualified domain name (FQDN) of the asset. + A Uniform Resource Identifier (URI) for the asset. + A serial number for the asset. + The NetBIOS name for the asset. + The media access control (MAC) address for the asset. + The physical location of the asset's hardware (e.g., Data Center ID, Cage#, Rack#, or other meaningful location identifiers). + is the asset subjected to network scans? (yes/no) + The model number of the hardware used by the asset. + The name of the operating system used by the asset. + The version of the operating system used by the asset. + The software product name used by the asset. + The software product version used by the asset. + The software product patch level used by the asset. + Simple indication of the asset's function, such as Router, Storage Array, DNS Server. + An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item. + An asset tag assigned by the organization responsible for maintaining the logical or tangible item. + Identifies whether the asset is publicly accessible (yes/no) + Identifies whether the asset is virtualized (yes/no) + Virtual LAN identifier of the asset. + The network identifier of the asset. + A human-readable label for the parent context. + An alternative identifier, whose value is easily sortable among other such values in the document. + The name of the baseline configuration for the asset. + Can the asset be check with an authenticated scan? (yes/no) + The function provided by the asset for the system. + + + System software that manages computer hardware, software resources, and provides common services for computer programs. + An electronic collection of data, or information, that is specially organized for rapid search and retrieval. + A system that delivers content or services to end users over the Internet or an intranet. + A system that resolves domain names to internet protocol (IP) addresses. + A computer system that sends and receives electronic mail messages. + A system that stores, organizes and provides access to directory information in order to unify network resources. + A private branch exchange (PBX) provides a a private telephone switchboard. + A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. + A physical or virtual networking device that forwards data packets between computer networks. + A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device. + A consolidated, block-level data storage capability. + A physical or virtual machine that centralizes hardware, software, or services for a specific purpose. + + + The name of the company or organization + + + The asset is included in periodic vulnerability scanning. + The asset is not included in periodic vulnerability scanning. + + + A reference to the baseline template used to configure the asset. + + + Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. + Responsible for administering a set of assets. + Members of the security operations center (SOC). + Members of the network operations center (NOC). + Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. + Responsible for providing information and support to users. + Responsible for the configuration management processes governing changes to the asset. + Responsible for the creation and maintenance of a component. + Organization responsible for providing the component, if this is different from the "maintainer" (e.g., a reseller). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The type of user, such as internal, external, or general-public. + The user's privilege level within the system, such as privileged, non-privileged, no-logical-access. + + + A user account for a person or entity that is part of the organization who owns or operates the system. + A user account for a person or entity that is not part of the organization who owns or operates the system. + A user of the system considered to be outside + + + This role has elevated access to the system, such as a group or system administrator. + This role has typical user-level access to the system without elevated access. + This role has no access to the system, such as a manager who approves access as part of a process. + + + Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. + Responsible for administering a set of assets. + Members of the security operations center (SOC). + Members of the network operations center (NOC). + Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. + Responsible for providing information and support to users. + Responsible for the configuration management processes governing changes to the asset. + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + **(deprecated)** Use 'assessment-objective' instead. + **(deprecated)** Use 'assessment-method' instead. + The part defines an assessment objective. + The part defines an assessment method. + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The assessment method to use. This typically appears on parts with the name "assessment". + + + + The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. + The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). + The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. + + + + + + + + + + + + + + + + + + + + + + + + + + + An assessment asset. + An assessment method. + Describes a set of control objectives. + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + + The assessment method to use. This typically appears on parts with the name "objective". + + + + The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. + The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). + The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + The assessment method to use. This typically appears on parts with the name "objective". + + + + The process of holding discussions with individuals or groups of individuals within an organization to once again, facilitate assessor understanding, achieve clarification, or obtain evidence. + The process of reviewing, inspecting, observing, studying, or analyzing one or more assessment objects (i.e., specifications, mechanisms, or activities). + The process of exercising one or more assessment objects (i.e., activities or mechanisms) under specified conditions to compare actual with expected behavior. + + + + + + + Defines the circumstances, conditions, degree, and manner in which the use of cyber-attack techniques or actions may be applied to the assessment. + Any information the assessor should make known to the system owner or authorizing official. Has child 'item' parts for each individual disclosure. + Defines any assessment activities which the system owner or authorizing official wishes to ensure are performed as part of the assessment. + Defines any assessment activities which the system owner or authorizing official explicitly prohibits from being performed as part of the assessment. + Defines conditions related to the delivery of the assessment results, such as when to deliver, how, and to whom. + Defines any supposition made by the assessor. Has child 'item' parts for each assumption. + An explanation of practices, procedures, and rules used in the course of the assessment. + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The referenced assessment subject is a component defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a inventory item defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a location defined in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a person or team to interview, who is defined as a party in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a user defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The system as a whole. + An external system, which may be a leveraged system or the other side of an interconnection. + A connection to something outside this system. + Any software, operating system, or firmware. + A physical device. + A service that may provide APIs. + An enforceable policy. + A tangible asset used to provide physical protections or countermeasures. + A list of steps or actions to take to achieve some end result. + An applicable plan. + Any guideline or recommendation. + Any organizational or industry standard. + An external assessment performed on some other component, that has been validated by a third-party. + A physical or virtual network. + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + The component is being designed, developed, or implemented. + The component is currently operational and is available for use in the system. + The component is no longer operational. + Some other state. + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Transmission Control Protocol + User Datagram Protocol + + + + + + + + It is a best practice to provide a UUID. + + + + + + + + + + Relative placement of component ('internal' or 'external') to the system. + UUID of the related leveraged-authorization assembly in this SSP. + UUID of the component as it was assigned in the leveraged system's SSP. + Simple indication of the asset's function, such as Router, Storage Array, DNS Server. + An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item. + An asset tag assigned by the organization responsible for maintaining the logical or tangible item. + Identifies whether the asset is publicly accessible (yes/no) + Identifies whether the asset is virtualized (yes/no) + Virtual LAN identifier of the asset. + The network identifier of the asset. + A human-readable label for the parent context. + An alternative identifier, whose value is easily sortable among other such values in the document. + The name of the baseline configuration for the asset. + Can the asset be check with an authenticated scan? (yes/no) + The function provided by the asset for the system. + The version of the component. + The specific patch level of the component. + The model of the component. + The date the component was released, such as a software release date or policy publication date. + Used with component-type='validation' to provide a well-known name for a kind of validation. + Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component. + + + A reference to another component that this component has a dependency on. + A reference to another component of component-type=validation, that is a validation (e.g., FIPS 140-2) for this component + A pointer to a validation record (e.g., FIPS 140-2) or other compliance information. + A reference to the baseline template used to configure the asset. + This service is used by the referenced component identifier. + A link to the system security plan of the external system. + This component uses the network provided by the identified network component. + + + Accountable for ensuring the asset is managed in accordance with organizational policies and procedures. + Responsible for administering a set of assets. + Members of the security operations center (SOC). + Members of the network operations center (NOC). + Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions. + Responsible for providing information and support to users. + Responsible for the configuration management processes governing changes to the asset. + Responsible for the creation and maintenance of a component. + Organization responsible for providing the component, if this is different from the "maintainer" (e.g., a reseller). + + + System software that manages computer hardware, software resources, and provides common services for computer programs. + An electronic collection of data, or information, that is specially organized for rapid search and retrieval. + A system that delivers content or services to end users over the Internet or an intranet. + A system that resolves domain names to internet protocol (IP) addresses. + A computer system that sends and receives electronic mail messages. + A system that stores, organizes and provides access to directory information in order to unify network resources. + A private branch exchange (PBX) provides a a private telephone switchboard. + A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. + A physical or virtual networking device that forwards data packets between computer networks. + A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device. + A consolidated, block-level data storage capability. + A physical or virtual machine that centralizes hardware, software, or services for a specific purpose. + + + The component allows an authenticated scan. + The component does not allow an authenticated scan. + + + The component is publicly accessible. + The component is not publicly accessible. + + + The component is virtualized. + The component is not virtualized. + + + The component is implemented within the system boundary. + The component is implemented outside the system boundary. + + + + + + + + The name of the company or organization + + + A link to an online information provided by the authorizing body. + + + If a "software" component-type, the identifier, such as a SWID tag, for the software component. + + + This service is provided by the referenced component identifier. + This service is used by the referenced component identifier. + + + + Title of the Interconnection Security Agreement (ISA). + Date of the Interconnection Security Agreement (ISA). + The name of the remote interconnected system. + An Internet Protocol Version 4 interconnection address + An Internet Protocol Version 6 interconnection address + An Internet Protocol Version 6 interconnection address + + + The identified IP address is for this system. + The identified IP address is for the remote system to which this system is connected. + + + A link to the system interconnection agreement. + + + Interconnection Security Agreement (ISA) point of contact (POC) for this system. + Interconnection Security Agreement (ISA) point of contact (POC) for the remote interconnected system. + Interconnection Security Agreement (ISA) authorizing official for this system. + Interconnection Security Agreement (ISA) authorizing official for the remote interconnected system. + + + + + + Data from the remote system flows into this system. + Data from this system flows to the remote system. + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The task represents a planned milestone. + The task represents a specific assessment action to be performed. + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The period is specified in seconds. + The period is specified in minutes. + The period is specified in hours. + The period is specified in days. + The period is specified in calendar months. + The period is specified in calendar years. + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The referenced assessment subject is a component defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a inventory item defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a location defined in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a person or team to interview, who is defined as a party in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a user defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The referenced assessment subject is a component defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a inventory item defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + The referenced assessment subject is a location defined in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a person or team to interview, who is defined as a party in the metadata of the SSP, Assessment Plan, or Assessment Results. + The referenced assessment subject is a user defined in the SSP, or in the local-definitions of an Assessment Plan or Assessment Results. + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component + Inventory Item + Location + Interview Party + User + Resource or Artifact + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + A Digital Object Identifier (DOI); use is preferred, since this allows for retrieval of a full bibliographic record. + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + The SHA-224 algorithm as defined by NIST FIPS 180-4. + + The SHA-256 algorithm as defined by NIST FIPS 180-4. + + The SHA-384 algorithm as defined by NIST FIPS 180-4. + + The SHA-512 algorithm as defined by NIST FIPS 180-4. + + The SHA3-224 algorithm as defined by NIST FIPS 202. + + The SHA3-256 algorithm as defined by NIST FIPS 202. + + The SHA3-384 algorithm as defined by NIST FIPS 202. + + The SHA3-512 algorithm as defined by NIST FIPS 202. + + + + + + + + + + + + + + + + + + + + Identifies the type of resource represented. + For resources representing a published document, this represents the version number of that document. + For resources representing a published document, this represents the publication date of that document. + + + + Indicates the resource is an organization's logo. + Indicates the resource represents an image. + Indicates the resource represents an image of screen content. + Indicates the resource represents an applicable law. + Indicates the resource represents an applicable regulation. + Indicates the resource represents an applicable standard. + Indicates the resource represents applicable guidance. + Indicates the resource provides a list of relevant acronyms. + Indicates the resource cites relevant information. + Indicates the resource is a policy. + Indicates the resource is a procedure. + Indicates the resource is guidance document related to the subject system of an SSP. + Indicates the resource is guidance document a user's guide or administrator's guide. + Indicates the resource is guidance document a administrator's guide. + Indicates the resource represents rules of behavior content. + Indicates the resource represents a plan. + Indicates the resource represents an artifact, such as may be reviewed by an assessor. + Indicates the resource represents evidence, such as to support an assessment findiing. + Indicates the resource represents output from a tool. + Indicates the resource represents machine data, which may require a tool or analysis for interpretation or presentation. + Indicates the resource represents notes from an interview, such as may be collected during an assessment. + Indicates the resource is a set of questions, possibly with responses. + Indicates the resource is a report. + Indicates the resource is a formal agreement between two or more parties. + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/converter-gen/testing/definition-maps/profile-reduce-map-output.xml b/src/converter-gen/testing/definition-maps/profile-reduce-map-output.xml new file mode 100644 index 00000000..93e88da9 --- /dev/null +++ b/src/converter-gen/testing/definition-maps/profile-reduce-map-output.xml @@ -0,0 +1,7009 @@ + + + + OSCAL Profile Model + 1.0.4 + oscal-profile + http://csrc.nist.gov/ns/oscal/1.0 + http://csrc.nist.gov/ns/oscal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + The link identifies the authoritative location for this file. Defined by RFC 6596. + The link identifies an alternative location or format for this file. Defined by the HTML Living Standard + + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + + + + + + + + + + A Digital Object Identifier (DOI); use is preferred, since this allows for retrieval of a full bibliographic record. + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A home address. + A work address. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A home phone number. + An office phone number. + A mobile phone number. + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + Characterizes the kind of location. + + + A location that contains computing assets. A class can be used to indicate the sub-type of data-center as primary or alternate. + + + The location is a data-center used for normal operations. + The location is a data-center used for fail-over or backup operations. + + + + + + + + + + + An individual. + A group of individuals formed for a specific purpose. + + + + + + + + + + + + + + + The identifier is Open Researcher and Contributor ID (ORCID). + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + A home phone number. + An office phone number. + A mobile phone number. + + + + + + + + + + + + + A home address. + A work address. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A mail stop associated with the party. + The name or number of the party's office. + The formal job title of a person. + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indicates the organization that created this content. + Indicates the organization that prepared this content. + Indicates the organization for which this content was created. + Indicates the organization responsible for all content represented in the "document". + Indicates the organization to contact for questions or support related to this content. + + + The value identifies a comma-seperated listing of keywords associated with this content. These keywords may be used as search terms for indexing and other applications. + + + The link identifies the authoritative location for this file. Defined by RFC 6596. + The link identifies an alternative location or format for this file. Defined by the HTML Living Standard + + This link identifies a resource containing the latest version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + This link identifies a resource containing the predecessor version in the version history. Defined by RFC 5829. + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + + Use the first definition - the first control with a given ID is used; subsequent ones are discarded + **(deprecated)** **(unspecified)** Merge - controls with the same ID are combined + Keep - controls with the same ID are kept, retaining the clash + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only one value is permitted. + One or more values are permitted. + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + An alternate to the value provided by the parameter's label. This will typically be qualified by a class. + + + The parent parameter provides an aggregation of 2 or more other parameters, each described by this property. + + + depends-on is deprecated + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + + + + + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + Include child controls with an included control. + When importing a control, only include child controls that are also explicitly called. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only one value is permitted. + One or more values are permitted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Preceding the id-ref target + Following the id-ref target + Inside the control or id-ref target, at the start + Inside the control or id-ref target, at the end + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only one value is permitted. + One or more values are permitted. + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + An alternate to the value provided by the parameter's label. This will typically be qualified by a class. + + + The parent parameter provides an aggregation of 2 or more other parameters, each described by this property. + + + depends-on is deprecated + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases. + An alternative identifier, whose value is easily sortable among other such values in the document. + An alternate or aliased identifier for the parent context. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + A Digital Object Identifier (DOI); use is preferred, since this allows for retrieval of a full bibliographic record. + + + + + + + + + + + + + + + + A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value. + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + The SHA-224 algorithm as defined by NIST FIPS 180-4. + + The SHA-256 algorithm as defined by NIST FIPS 180-4. + + The SHA-384 algorithm as defined by NIST FIPS 180-4. + + The SHA-512 algorithm as defined by NIST FIPS 180-4. + + The SHA3-224 algorithm as defined by NIST FIPS 202. + + The SHA3-256 algorithm as defined by NIST FIPS 202. + + The SHA3-384 algorithm as defined by NIST FIPS 202. + + The SHA3-512 algorithm as defined by NIST FIPS 202. + + + + + + + + + + + + + + + + + + + + Identifies the type of resource represented. + For resources representing a published document, this represents the version number of that document. + For resources representing a published document, this represents the publication date of that document. + + + + Indicates the resource is an organization's logo. + Indicates the resource represents an image. + Indicates the resource represents an image of screen content. + Indicates the resource represents an applicable law. + Indicates the resource represents an applicable regulation. + Indicates the resource represents an applicable standard. + Indicates the resource represents applicable guidance. + Indicates the resource provides a list of relevant acronyms. + Indicates the resource cites relevant information. + Indicates the resource is a policy. + Indicates the resource is a procedure. + Indicates the resource is guidance document related to the subject system of an SSP. + Indicates the resource is guidance document a user's guide or administrator's guide. + Indicates the resource is guidance document a administrator's guide. + Indicates the resource represents rules of behavior content. + Indicates the resource represents a plan. + Indicates the resource represents an artifact, such as may be reviewed by an assessor. + Indicates the resource represents evidence, such as to support an assessment findiing. + Indicates the resource represents output from a tool. + Indicates the resource represents machine data, which may require a tool or analysis for interpretation or presentation. + Indicates the resource represents notes from an interview, such as may be collected during an assessment. + Indicates the resource is a set of questions, possibly with responses. + Indicates the resource is a report. + Indicates the resource is a formal agreement between two or more parties. + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/converter-gen/testing/xml-converters/computer-build-xml-converter.xsl b/src/converter-gen/testing/xml-converters/computer-build-xml-converter.xsl new file mode 100644 index 00000000..db3565a3 --- /dev/null +++ b/src/converter-gen/testing/xml-converters/computer-build-xml-converter.xsl @@ -0,0 +1,12 @@ + + + + +http://csrc.nist.gov/ns/oscal/1.0 + diff --git a/src/converter-gen/testing/xml-to-json/produce-xml-converter-json-usage.xspec b/src/converter-gen/testing/xml-to-json/produce-xml-converter-json-usage.xspec new file mode 100644 index 00000000..28db3324 --- /dev/null +++ b/src/converter-gen/testing/xml-to-json/produce-xml-converter-json-usage.xspec @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stub + + + + + + + + + + + + stub + + + + + + + + + + + diff --git a/src/converter-gen/testing/xml-to-json/produce-xml-converter.xspec b/src/converter-gen/testing/xml-to-json/produce-xml-converter.xspec index d679de27..94a1a975 100644 --- a/src/converter-gen/testing/xml-to-json/produce-xml-converter.xspec +++ b/src/converter-gen/testing/xml-to-json/produce-xml-converter.xspec @@ -1,14 +1,61 @@ + + + + + + + + + stub + + + + + + + + + + stub + + + + + + + + + + + + + + + + + + + + + + + + ... + ... + ... + + + + + + + + + + + + + + + + + ... + ... + ... + ... + + + + + + + + + + + + + + + ... + ... + ... + + + + + + + + + + + + + + + ... + ... + ... + ... + + + + + + + + + + + + + + + + ... + ... + ... + + + + + + + + + + + + + + + + ... + ... + + + + + + + + + + + + + + + + ... + ... + ... + + + + + + + + + + + + + + + + + + + + ... + ... + ... + ... + + + + + + + + + + + + + + + + ... + ... + ... + + + + + + + + + + + + + + + + + + ... + ... + ... + ... + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://csrc.nist.gov/ns/oscal/1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + remarks + + ... + + + + + + + + + + + + + + + + ... + + + + + + + + + + + + + + + ... + + + + + + + + + + + + + + + + + + ... + + + + + + + + + + + + + + + + + + + k + + + + + + + + + + + + + + ... + + + + + + + + + + + + + + + + + + + + + + ... + + + + + + + + ... + + + + + ... + + + + + + + + + + + + + + ... + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ... + + + + + + + + + + + + + + + ... + ... + ... + ... + ... + ... + + + + + + + + + + + + + + ... + ... + ... + ... + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + prop/@uuid + + + + profile/@uuid + + + + + + + + + + + + group/part/@id | group/part//part/@id | add/part/@id | add/part//part/@id + + + + + + + + + + + + + + + + + + link1/@href | link2/@href + + + + + + + + + + + + + + + + + + link/@href + + + + + + + + + @uuid + + + + + + + + + prop + + + + + + + + prop + + + + + + + + + + + + + group/part | group/part//part | add/part | add/part//part + + + + + + + + + + + + + + + + { + concat( + 'alias/assembly-1only | alias/assembly-1only//assembly-1only | ', + 'alias/assembly-1only | alias/assembly-1only//assembly-1only | ', + 'EVERYTHING/assembly-1only | EVERYTHING/assembly-1only//assembly-1only | ', + '/ASSEMBLY-1ONLY | ASSEMBLY-1ONLY//assembly-1only' + )} + + + + + + + + + metadata/location + + + + + + + + + + + param/value | set-parameter/value | param/value + + + + + + + + + + + profile + + + + + + + + part + + + + + + + + + + + + + + + profile/merge/custom + + + + + + + + + + + + + profile//merge/custom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ... + + + + + + + + + + A label or descriptor that... + + + + + + + + + + + ... + + + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ... + + + ... + + + + + + + + + + + + + + + + + + ... + + + ... + + + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/converter-gen/testing/xml-to-json/test-helper-xml-to-json.xsl b/src/converter-gen/testing/xml-to-json/test-helper-xml-to-json.xsl new file mode 100644 index 00000000..5f91850b --- /dev/null +++ b/src/converter-gen/testing/xml-to-json/test-helper-xml-to-json.xsl @@ -0,0 +1,37 @@ + + + + + + Reached make-xml-pull mode + + + + + Reached make-xml-match mode + for any-element + + + + Reached make-json-pull mode + + + + Reached make-template mode + + + \ No newline at end of file diff --git a/src/converter-gen/xml-to-json/produce-xml-converter.xsl b/src/converter-gen/xml-to-json/produce-xml-converter.xsl index b5aa513c..84c8d2df 100644 --- a/src/converter-gen/xml-to-json/produce-xml-converter.xsl +++ b/src/converter-gen/xml-to-json/produce-xml-converter.xsl @@ -6,7 +6,8 @@ xpath-default-namespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0" version="3.0" - xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0/supermodel"> + xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0/supermodel" + xmlns:sm="http://csrc.nist.gov/ns/oscal/metaschema/1.0/supermodel"> @@ -33,7 +34,7 @@ - + @@ -58,7 +59,8 @@ - + @@ -70,7 +72,8 @@ - + @@ -97,24 +100,25 @@ - + { $source-namespace } - + - - + + + - + METASCHEMA conversion stylesheet supports XML -> METASCHEMA/SUPERMODEL conversion - + @@ -125,9 +129,10 @@ - + + - + @@ -138,28 +143,37 @@ - + - + - + - + - - - - + + + + + + + - + @@ -187,9 +201,9 @@ - - + + @@ -197,8 +211,9 @@ - - + + @@ -219,18 +234,23 @@ - - - - - - - + + + + + + + + - - + + @@ -244,8 +264,8 @@ - - + + @@ -259,39 +279,43 @@ b3/a (when a does not recurse inside b3)--> - + - - - - - - - - - - | - - + + + + + + + + + + + | + + + / + + / - - - / - / - - - - - - - - - + / + + + + + + + + + + - + - + + @@ -371,6 +396,7 @@ + @@ -378,17 +404,19 @@ - + - p | ul | ol | pre | h1 | h2 | h3 | h4 | h5 | h6 | table + p | ul | ol | pre | h1 | h2 | h3 | h4 | h5 | h6 | table - + + @@ -400,8 +428,9 @@ - - + + @@ -411,22 +440,23 @@ --> - - - + + + - + - + @@ -435,11 +465,11 @@ - + string - + boolean @@ -457,26 +487,29 @@ decimal - + number - + - + - + - + \ No newline at end of file diff --git a/src/schema-gen/InspectorXSLT/Makefile b/src/schema-gen/InspectorXSLT/Makefile index 5a9e87bb..5d7854dc 100644 --- a/src/schema-gen/InspectorXSLT/Makefile +++ b/src/schema-gen/InspectorXSLT/Makefile @@ -10,8 +10,8 @@ include ../../testing/make_common.mk module_path:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) output_folder:=$(module_path)/test_output -xspec_script=$(realpath $(module_path)/../../../support/xspec-dev/mvn-saxon-xspec-batch-quiet.sh) -xspec_ci_script=$(realpath $(module_path)/../../../support/xspec-dev/mvn-saxon-xspec-batch.sh) +xspec_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch-quiet.sh) +xspec_ci_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch.sh) smoketest_script=$(realpath $(module_path)/testing/smoketest-computer-inspector.sh) testing-refresh_script=$(realpath $(module_path)/testing/refresh-test-inspectors.sh) folder=. diff --git a/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-inspector.xsl b/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-inspector.xsl index 4865e3aa..f38ee0f5 100644 --- a/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-inspector.xsl +++ b/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-inspector.xsl @@ -1,11 +1,10 @@ - + exclude-result-prefixes="#all"> diff --git a/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-schema.xsd b/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-schema.xsd index 4fa290d5..193337c0 100644 --- a/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-schema.xsd +++ b/src/schema-gen/InspectorXSLT/testing/current/computer_metaschema-schema.xsd @@ -1,11 +1,10 @@ - + xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + elementFormDefault="qualified" + targetNamespace="http://example.com/ns/computer" + version="0.0.5"> Computer Model @@ -64,7 +63,7 @@ - + Vendor Identifier @@ -74,6 +73,16 @@ Vendor Identifier: An identifier for classifying a unique computer parts vendor. + + + + Vendor Reference + Instead of an identifier, a reference to another vendor by its @id. + + + Vendor Reference: Instead of an identifier, a reference to another vendor by its @id. + + @@ -122,9 +131,9 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -150,17 +159,17 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> + type="computer-product-name-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-cost-FIELD" + minOccurs="0" + maxOccurs="1"/> @@ -188,9 +197,9 @@ + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -207,17 +216,17 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> + type="computer-product-name-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-cost-FIELD" + minOccurs="0" + maxOccurs="1"/> @@ -232,9 +241,9 @@ + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -271,17 +280,17 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> + type="computer-product-name-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-cost-FIELD" + minOccurs="0" + maxOccurs="1"/> @@ -296,9 +305,9 @@ + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -314,9 +323,9 @@ + type="computer-cooling-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -329,17 +338,17 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> + type="computer-product-name-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-cost-FIELD" + minOccurs="0" + maxOccurs="1"/> @@ -354,9 +363,9 @@ + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -406,21 +415,21 @@ + type="computer-vendor-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> + type="computer-product-name-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-cost-FIELD" + minOccurs="0" + maxOccurs="1"/> + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -436,9 +445,9 @@ + type="computer-property-ASSEMBLY" + minOccurs="0" + maxOccurs="1"/> @@ -689,9 +698,9 @@ + type="listItemType" + minOccurs="1" + maxOccurs="unbounded"/> diff --git a/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-inspector.xsl b/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-inspector.xsl index 44cb4883..79fffe88 100644 --- a/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-inspector.xsl +++ b/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-inspector.xsl @@ -1,11 +1,10 @@ - + xmlns:mx="http://csrc.nist.gov/ns/csd/metaschema-xslt" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="3.0" + xpath-default-namespace="http://example.com/ns/tinydata" + exclude-result-prefixes="#all"> @@ -21,29 +20,29 @@ + priority="100" + name="xsl:initial-template" + match="root()"> + priority="101" + match="root()[$format=('mx','mx-report')]"> + priority="101" + match="root()[$format=('html','webpage')]"> + priority="101" + match="root()[$format=('md','markdown')]"> + priority="101" + match="root()[$format=('plaintext','plain','text')]"> @@ -87,9 +86,9 @@ + tunnel="true" + as="xs:string" + select="codepoints-to-string(10)"/> @@ -100,8 +99,8 @@ + on-no-match="fail" + on-multiple-match="use-last"/> @@ -134,14 +133,14 @@ + match="a/@href | a/@title | img/@alt | img/@src | img/@title | code/@class | insert/@id-ref | insert/@type (: other legal attributes :)"/> + match="p/br | li/br | h1/br | h2/br | h3/br | h4/br | h5/br | h6/br | pre/br | tr/br | td/br"/> + match="p/text() | li/text() | h1/text() | h2/text() | h3/text() | h4/text() | h5/text() | h6/text() | pre/text() | blockquote/text() | th/text() | td/text()"/> + match="em/text() | i/text() | strong/text() | b/text() | u/text() | q/text() | code/text() | a/text() | sub/text() | sup/text()"/> @@ -151,7 +150,7 @@ + select=" 'p', 'pre', 'ul', 'ol', 'table', 'h1', 'h2', 'h3', 'h4', 'h5'"/> @@ -161,8 +160,8 @@ + mode="test" + match="@xsi:*"/> @@ -181,10 +180,10 @@ + test="{ $testing }" + class="{$class}" + xpath="{ $xpath }" + level="{ $level }"> @@ -208,7 +207,7 @@ /{ name() } + match="*[node-name() = (../* except current())/node-name()]"> /{ name() }[{ mx:element-position(.)[count($kin) gt 1] }] @@ -271,11 +270,11 @@ + priority="103" + mode="grab-mx"> + select="count(.//mx:report[@level = ('CRITICAL', 'ERROR')])"/> @@ -291,8 +290,8 @@ + priority="102" + mode="grab-mx"> File { replace(@src,'.*/','') } is reported VALID, no issues ... @@ -304,22 +303,22 @@ + select="count(descendant::* except .//mx:*/descendant-or-self::*)"/> + select="count(descendant::*/@* except .//mx:*/descendant-or-self::*/@*)"/> + select="count(.//mx:report[@level = ('CRITICAL', 'ERROR')])"/> + mode="grab-mx"> + mode="grab-mx"> @@ -437,109 +436,109 @@ details p { margin: 0.2em 0em } { codepoints-to-string(10) } + match="html" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> + match="style" + xpath-default-namespace="http://www.w3.org/1999/xhtml"/> + match="body" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf } + match="div | details" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf2 }--- + match="body/*[1]/self::h1" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> # + match="h1" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf2 }# + match="h2" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf2 }## + match="h3 | details/summary" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf2 }### + match="p" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf2 } + match="ul" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> + match="li" + expand-text="true" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> { $lf }- + match="b" + priority="2" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> ** ** + match="i" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> * * + match="code" + priority="2" + xpath-default-namespace="http://www.w3.org/1999/xhtml"> ` ` Computer Model + shortname="computer" + namespace="http://example.com/ns/tinydata">Computer Model @@ -594,7 +593,7 @@ details p { margin: 0.2em 0em } EOOO element-out-of-order exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element title is unexpected following term, stuff, part, or notes/note. @@ -608,7 +607,7 @@ details p { margin: 0.2em 0em } EOOO element-out-of-order exists(preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element term is unexpected following stuff, part, or notes/note. @@ -636,7 +635,7 @@ details p { margin: 0.2em 0em } EOOO element-out-of-order exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element title is unexpected following term, stuff, part, or note. @@ -650,7 +649,7 @@ details p { margin: 0.2em 0em } EOOO element-out-of-order exists(preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element term is unexpected following stuff, part, or note. @@ -762,12 +761,12 @@ details p { margin: 0.2em 0em } gix.148 + as="xs:string" + select="($matching[matches(.,'\S')],'*')[1]"/> { $class } not(string(.) castable as xs:string and matches(.,'^\S(.*\S)?$')) + select="not(string(.) castable as xs:string and matches(.,'^\S(.*\S)?$'))"/> Value { string(.) } of { if (self::element()) then 'element' else 'attribute' } { self::attribute()/'@' }{ name(.) } does not conform to string datatype. @@ -779,111 +778,111 @@ details p { margin: 0.2em 0em } gix.148 + as="xs:string" + select="($matching[matches(.,'\S')],'*')[1]"/> { $class } not(string(.) castable as xs:string and matches(.,'^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$') and matches(.,'^\S(.*\S)?$')) + select="not(string(.) castable as xs:string and matches(.,'^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$') and matches(.,'^\S(.*\S)?$'))"/> Value { string(.) } of { if (self::element()) then 'element' else 'attribute' } { self::attribute()/'@' }{ name(.) } does not conform to token datatype. + match="title/a|title/insert|title/br|title/code|title/em|title/i|title/b|title/strong|title/sub|title/sup|title/q|title/img"/> + match="TINY/h1|TINY/h2|TINY/h3|TINY/h4|TINY/h5|TINY/h6|TINY/table|TINY/img|TINY/pre|TINY/hr|TINY/blockquote|TINY/ul|TINY/ol|TINY/p"> gix.390 EOOO element-out-of-order exists(preceding-sibling::part | preceding-sibling::notes) + select="exists(preceding-sibling::part | preceding-sibling::notes)"/> Element stuff is unexpected following part or notes/note. + match="part/h1|part/h2|part/h3|part/h4|part/h5|part/h6|part/table|part/img|part/pre|part/hr|part/blockquote|part/ul|part/ol|part/p"> gix.390 EOOO element-out-of-order exists(preceding-sibling::part | preceding-sibling::note) + select="exists(preceding-sibling::part | preceding-sibling::note)"/> Element stuff is unexpected following part or note. + match="TINY/notes/note/h1|TINY/notes/note/h2|TINY/notes/note/h3|TINY/notes/note/h4|TINY/notes/note/h5|TINY/notes/note/h6|TINY/notes/note/table|TINY/notes/note/img|TINY/notes/note/pre|TINY/notes/note/hr|TINY/notes/note/blockquote|TINY/notes/note/ul|TINY/notes/note/ol|TINY/notes/note/p"/> + match="part/note/h1|part/note/h2|part/note/h3|part/note/h4|part/note/h5|part/note/h6|part/note/table|part/note/img|part/note/pre|part/note/hr|part/note/blockquote|part/note/ul|part/note/ol|part/note/p"/> + match="TINY/title/a|TINY/title/insert|TINY/title/br|TINY/title/code|TINY/title/em|TINY/title/i|TINY/title/b|TINY/title/strong|TINY/title/sub|TINY/title/sup|TINY/title/q|TINY/title/img"> gix.390 EOOO element-out-of-order exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element title is unexpected following term, stuff, part, or notes/note. + match="part/title/a|part/title/insert|part/title/br|part/title/code|part/title/em|part/title/i|part/title/b|part/title/strong|part/title/sub|part/title/sup|part/title/q|part/title/img"> gix.390 EOOO element-out-of-order exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + select="exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p)"/> Element title is unexpected following term, stuff, part, or note. + match="h1/a|h2/a|h3/a|h4/a|h5/a|h6/a|table/a|pre/a|blockquote/a|ul/a|ol/a|p/a"/> + match="a/a|insert/a|code/a|em/a|i/a|b/a|strong/a|sub/a|sup/a|q/a"/> + match="h1/insert|h2/insert|h3/insert|h4/insert|h5/insert|h6/insert|table/insert|pre/insert|blockquote/insert|ul/insert|ol/insert|p/insert"/> + match="a/insert|insert/insert|code/insert|em/insert|i/insert|b/insert|strong/insert|sub/insert|sup/insert|q/insert"/> + match="h1/br|h2/br|h3/br|h4/br|h5/br|h6/br|table/br|pre/br|blockquote/br|ul/br|ol/br|p/br"/> + match="a/br|insert/br|code/br|em/br|i/br|b/br|strong/br|sub/br|sup/br|q/br"/> + match="h1/code|h2/code|h3/code|h4/code|h5/code|h6/code|table/code|pre/code|blockquote/code|ul/code|ol/code|p/code"/> + match="a/code|insert/code|code/code|em/code|i/code|b/code|strong/code|sub/code|sup/code|q/code"/> + match="h1/em|h2/em|h3/em|h4/em|h5/em|h6/em|table/em|pre/em|blockquote/em|ul/em|ol/em|p/em"/> + match="a/em|insert/em|code/em|em/em|i/em|b/em|strong/em|sub/em|sup/em|q/em"/> + match="h1/i|h2/i|h3/i|h4/i|h5/i|h6/i|table/i|pre/i|blockquote/i|ul/i|ol/i|p/i"/> + match="a/i|insert/i|code/i|em/i|i/i|b/i|strong/i|sub/i|sup/i|q/i"/> + match="h1/b|h2/b|h3/b|h4/b|h5/b|h6/b|table/b|pre/b|blockquote/b|ul/b|ol/b|p/b"/> + match="a/b|insert/b|code/b|em/b|i/b|b/b|strong/b|sub/b|sup/b|q/b"/> + match="h1/strong|h2/strong|h3/strong|h4/strong|h5/strong|h6/strong|table/strong|pre/strong|blockquote/strong|ul/strong|ol/strong|p/strong"/> + match="a/strong|insert/strong|code/strong|em/strong|i/strong|b/strong|strong/strong|sub/strong|sup/strong|q/strong"/> + match="h1/sub|h2/sub|h3/sub|h4/sub|h5/sub|h6/sub|table/sub|pre/sub|blockquote/sub|ul/sub|ol/sub|p/sub"/> + match="a/sub|insert/sub|code/sub|em/sub|i/sub|b/sub|strong/sub|sub/sub|sup/sub|q/sub"/> + match="h1/sup|h2/sup|h3/sup|h4/sup|h5/sup|h6/sup|table/sup|pre/sup|blockquote/sup|ul/sup|ol/sup|p/sup"/> + match="a/sup|insert/sup|code/sup|em/sup|i/sup|b/sup|strong/sup|sub/sup|sup/sup|q/sup"/> + match="h1/q|h2/q|h3/q|h4/q|h5/q|h6/q|table/q|pre/q|blockquote/q|ul/q|ol/q|p/q"/> + match="a/q|insert/q|code/q|em/q|i/q|b/q|strong/q|sub/q|sup/q|q/q"/> + match="h1/img|h2/img|h3/img|h4/img|h5/img|h6/img|table/img|pre/img|blockquote/img|ul/img|ol/img|p/img"/> + match="a/img|insert/img|code/img|em/img|i/img|b/img|strong/img|sub/img|sup/img|q/img"/> diff --git a/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-schema.xsd b/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-schema.xsd index 8abaa3d5..ee5828b7 100644 --- a/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-schema.xsd +++ b/src/schema-gen/InspectorXSLT/testing/current/tiny_metaschema-schema.xsd @@ -1,11 +1,10 @@ - + xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + elementFormDefault="qualified" + targetNamespace="http://example.com/ns/tinydata" + version="0.0.5"> Computer Model @@ -30,18 +29,18 @@ + type="computer-title-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-term-FIELD" + minOccurs="0" + maxOccurs="unbounded"/> + type="computer-part-ASSEMBLY" + minOccurs="0" + maxOccurs="unbounded"/> @@ -134,18 +133,18 @@ + type="computer-title-FIELD" + minOccurs="1" + maxOccurs="1"/> + type="computer-term-FIELD" + minOccurs="0" + maxOccurs="unbounded"/> + type="computer-part-ASSEMBLY" + minOccurs="0" + maxOccurs="unbounded"/> @@ -208,9 +207,9 @@ + type="listItemType" + minOccurs="1" + maxOccurs="unbounded"/> diff --git a/src/schema-gen/InspectorXSLT/testing/refresh-computer-inspector.sh b/src/schema-gen/InspectorXSLT/testing/refresh-computer-inspector.sh index 195b787d..533c6788 100644 --- a/src/schema-gen/InspectorXSLT/testing/refresh-computer-inspector.sh +++ b/src/schema-gen/InspectorXSLT/testing/refresh-computer-inspector.sh @@ -28,8 +28,18 @@ ADDITIONAL_ARGS=$(echo "${*// /\\ }") CALABASH_ARGS="-oINSPECTOR-XSLT=\"$XSLT_RESULT\" $ADDITIONAL_ARGS \"${XPROC_FILE}\"" -# echo "${CALABASH_ARGS}" +## show usage if a first argument is '-h', expanding $1 to '' if not set +if [ "${1:-}" = '-h' ] || [ "${1:-}" = '--help' ]; + +then + + usage +else + +# echo "${CALABASH_ARGS}" invoke_calabash "${CALABASH_ARGS}" echo Computer Model Inspector XSLT refreshed - check - + +fi diff --git a/src/schema-gen/InspectorXSLT/testing/refresh-test-inspectors.sh b/src/schema-gen/InspectorXSLT/testing/refresh-test-inspectors.sh index ac4841f1..fc72d481 100644 --- a/src/schema-gen/InspectorXSLT/testing/refresh-test-inspectors.sh +++ b/src/schema-gen/InspectorXSLT/testing/refresh-test-inspectors.sh @@ -26,8 +26,20 @@ ADDITIONAL_ARGS=$(echo "${*// /\\ }") # -iMETASCHEMA=computer_metaschema.xml -iMETASCHEMA=tiny_metaschema.xml CALABASH_ARGS="$ADDITIONAL_ARGS \"${XPROC_FILE}\"" + + +## show usage if a first argument is '-h', expanding $1 to '' if not set +if [ "${1:-}" = '-h' ] || [ "${1:-}" = '--help' ]; + +then + + usage + +else + # echo "${CALABASH_ARGS}" invoke_calabash "${CALABASH_ARGS}" -# invoke_calabash "-iMETASCHEMA=computer_metaschema.xml -iMETASCHEMA=tiny_metaschema.xml "${CALABASH_ARGS}" echo Current test models refreshed - InspectorXSLT and XSD - check 'current' + +fi \ No newline at end of file diff --git a/src/schema-gen/InspectorXSLT/testing/smoketest-computer-inspector.sh b/src/schema-gen/InspectorXSLT/testing/smoketest-computer-inspector.sh index db1e7d32..ca39ee68 100644 --- a/src/schema-gen/InspectorXSLT/testing/smoketest-computer-inspector.sh +++ b/src/schema-gen/InspectorXSLT/testing/smoketest-computer-inspector.sh @@ -26,7 +26,17 @@ ADDITIONAL_ARGS=$(echo "${*// /\\ }") CALABASH_ARGS="-oINSPECTOR-XSLT=/dev/null $ADDITIONAL_ARGS \"${XPROC_FILE}\"" # echo "${CALABASH_ARGS}" +## show usage if a first argument is '-h', expanding $1 to '' if not set +if [ "${1:-}" = '-h' ] || [ "${1:-}" = '--help' ]; + +then + + usage + +else invoke_calabash "${CALABASH_ARGS}" -echo Computer Model Inspector XSLT produced and run - without apparent error \ No newline at end of file +echo Computer Model Inspector XSLT produced and run - without apparent error + +fi diff --git a/src/schema-gen/InspectorXSLT/testing/tests/inspector-functional-xspec/xspec-patterns.xspec b/src/schema-gen/InspectorXSLT/testing/tests/inspector-functional-xspec/xspec-patterns.xspec index c3fb7592..0185d4a8 100644 --- a/src/schema-gen/InspectorXSLT/testing/tests/inspector-functional-xspec/xspec-patterns.xspec +++ b/src/schema-gen/InspectorXSLT/testing/tests/inspector-functional-xspec/xspec-patterns.xspec @@ -91,6 +91,7 @@ Modes to test: + diff --git a/src/schema-gen/JSON-schema/Makefile b/src/schema-gen/JSON-schema/Makefile new file mode 100644 index 00000000..807f1632 --- /dev/null +++ b/src/schema-gen/JSON-schema/Makefile @@ -0,0 +1,52 @@ +include ../../testing/make_common.mk + +# INCLUDES: +# unit-test - unit testing - XSLT production templates for InspectorXSLT +# spec-test - specification conformance testing - functional runtime tests of the generated XSLT +# xspec - run XSpec tests in designated folder +# clean - clean up designated output folder + +# for smoke testing see ../Makefile + +# tbd - 'field testing' applying result JSON Schema to known 'working and broken' instances + +module_path:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +output_folder:=$(module_path)/test_output +xspec_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch-quiet.sh) +xspec_ci_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch.sh) +folder=. + +.PHONY: test +test: unit-test spec-test ## Run all tests + + +.PHONY: spec-test +spec-test: ## Run all specification tests + LOGFILE="$(output_folder)/jsonschemagen-mapping.log" $(xspec_ci_script) \ + "folder=$(module_path)/testing/tests/jsonschemagen-mapping-xspec/" \ + "report-to=$(output_folder)/jsonschemagen-mapping_report.html" \ + "junit-to=$(output_folder)/jsonschemagen-mapping_junit-report.xml" \ + "stop-on-error=yes" \ + "recurse=yes" + +.PHONY: unit-test +unit-test: ## Run all unit tests + LOGFILE="$(output_folder)/jsonschemagen-runtime.log" $(xspec_ci_script) \ + "folder=$(module_path)/testing/tests/jsonschemagen-runtime-xspec" \ + "report-to=$(output_folder)/jsonschemagen-runtime_report.html" \ + "junit-to=$(output_folder)/jsonschemagen-runtime_junit-report.xml" \ + "stop-on-error=yes" \ + "recurse=yes" + +.PHONY: xspec +xspec: ## Run all *.xspec in a designated folder, quietly - use folder=[folder] + LOGFILE="$(output_folder)/$(folder)-xspec-tests.log" $(xspec_script) \ + "baseURI=file:$(module_path)/" \ + "folder=$(folder)" \ + "report-to=$(output_folder)/inspector-$(folder)-tests_report.html" \ + "stop-on-error=no" \ + "recurse=yes" + +.PHONY: clean +clean: ## Remove test output + rm -fr $(output_folder)/* \ No newline at end of file diff --git a/src/schema-gen/JSON-schema/choice-split.xsl b/src/schema-gen/JSON-schema/choice-split.xsl new file mode 100644 index 00000000..6c2b618a --- /dev/null +++ b/src/schema-gen/JSON-schema/choice-split.xsl @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/schema-gen/JSON-schema/make-json-schema-metamap.xsl b/src/schema-gen/JSON-schema/make-json-schema-metamap.xsl index c0c54878..d022c957 100644 --- a/src/schema-gen/JSON-schema/make-json-schema-metamap.xsl +++ b/src/schema-gen/JSON-schema/make-json-schema-metamap.xsl @@ -145,8 +145,11 @@ - - + + + object @@ -156,7 +159,59 @@ - + + + + + + + + + + + + + object + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -167,6 +222,7 @@ + @@ -199,8 +255,6 @@ - - @@ -216,6 +270,7 @@ + @@ -281,6 +336,8 @@ + + @@ -296,7 +353,7 @@ + $with-model/(field|define-field|assembly|define-assembly)[@min-occurs > 0]"/> @@ -305,7 +362,7 @@ - true + true false @@ -425,8 +482,8 @@ + assembly[group-as/@in-json='BY_KEY'][exists(key('assembly-definition-by-name',@_key-ref, $composed-metaschema)/json-key)] | + field[group-as/@in-json='BY_KEY'][exists(key('field-definition-by-name', @_key-ref, $composed-metaschema)/json-key)]"> object @@ -444,7 +501,7 @@ - + @@ -453,7 +510,7 @@ - + @@ -509,17 +566,17 @@ - + - + - + @@ -550,8 +607,8 @@ - - + + string diff --git a/src/schema-gen/JSON-schema/testing.md b/src/schema-gen/JSON-schema/testing.md new file mode 100644 index 00000000..9e90c370 --- /dev/null +++ b/src/schema-gen/JSON-schema/testing.md @@ -0,0 +1,73 @@ +# Testing Metaschema-XSLT JSON Schema production + +**Currently only JSON Schema v7 is supported.** + +At a future date we aim to support other forms. + +## Smoke testing + +A JSON Schema, with other schemas, is produced by a pipeline in the parent directory, ../METASCHEMA-ALL-SCHEMAS.xpl, which is also run as a smoke test. + +``` +pushd .. +make smoke-test +popd +``` + +The smoke test outputs including a JSON Schema are found in the `test_output` folder (until/unless cleaned out). If a JSON instance cannot be produced, the process will fail. +The smoke test does *not* currently + +- test that the JSON functions as a JSON Schema +- test that it conforms to an idea of a JSON Schema ('the standard') or JSON Schema usage patterns + +It does, however, confirm that the process terminated successfully with a file output in the expected location. + + +## Spec testing + +In this case, 'spec testing' is testing to see whether the resulting JSON Schema looks like what we think it should look like, in detail. + +## Unit testing + +Unit tests here focus on end-to-end testing, i.e. per-metaschema mappings from single model input to single JSON Schema output. + +The unit testing here is *less* granular than the specification testing. + +Neither of these actually test the JSON Schema, only the way in which one is produced. + + +This implies near-term and longer-term goals: + +# JSON Schema generation - planning + +## Near-term + +Even without running the JSON Schema (a 'field-test' to demonstrate its adequacy for the purpose, i.e. validation), we can test a great deal since we know what that JSON Schema should look like. + +I.e., we can test the mapping of Metaschema semantics into JSON by sketching the transformation from Metaschema source to the JSON Schema in its XML precursor format. + +- [ ] XSpec the XSLT + - [ ] `make-json-schema-metamap.xsl` for unit testing + - [ ] `../nist-metaschema-MAKE-JSON-SCHEMA-as-xml.xsl` with @external='true' for end to end +- [ ] Flesh out with micro-examples of special cases +- [ ] Deal with `choice` https://github.com/usnistgov/metaschema-xslt/issues/105 + +cf https://github.com/usnistgov/OSCAL/issues/1989 + +This will give us something to show that we can generate correct outputs, for given inputs, in the general case. + +Note that in this repo, the OSCAL models will *not* be used. + +(But it can be used in parallel work in the oscal-xslt repository.) + +## Longer-term + +"Field test" script able to distinguish between expected-valid and expected-invalid JSON, and report findings. + +Something that could be reused in oscal-xslt over OSCAL inputs, for example. + +## Punchlist + +- [ ] XSpec to test metamap XSLT +- [x] Makefile to run this XSpec using xspec-dev script cf ../InspectorXSLT/Makefile +- [ ] Show tests with proposed solution(s) via PR \ No newline at end of file diff --git a/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/choice-splitting.xspec b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/choice-splitting.xspec new file mode 100644 index 00000000..38c94ca5 --- /dev/null +++ b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/choice-splitting.xspec @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/metamap-test.xspec b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/metamap-test.xspec new file mode 100644 index 00000000..4a617357 --- /dev/null +++ b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-mapping-xspec/metamap-test.xspec @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-runtime-xspec/jsonschema-gen-test.xspec b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-runtime-xspec/jsonschema-gen-test.xspec new file mode 100644 index 00000000..11eab3a4 --- /dev/null +++ b/src/schema-gen/JSON-schema/testing/tests/jsonschemagen-runtime-xspec/jsonschema-gen-test.xspec @@ -0,0 +1,49 @@ + + + + + + + + + + + + + On + + + + + + ... + + + + + + + + diff --git a/src/schema-gen/METASCHEMA-ALL-VALIDATORS.xpl b/src/schema-gen/METASCHEMA-ALL-VALIDATORS.xpl new file mode 100644 index 00000000..6b644191 --- /dev/null +++ b/src/schema-gen/METASCHEMA-ALL-VALIDATORS.xpl @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/schema-gen/Makefile b/src/schema-gen/Makefile index 6a23d2e1..e88e0d86 100644 --- a/src/schema-gen/Makefile +++ b/src/schema-gen/Makefile @@ -4,13 +4,24 @@ include ../testing/make_common.mk test_metaschema:=../testing/models_metaschema.xml output_folder:=test_output + .PHONY: test -test: smoke-test ## Run all tests +test: smoke-test unit-test ## Run all tests + .PHONY: smoke-test -smoke-test: ## Run all smoke-tests +smoke-test: ## Generate schemas from ../testing/models_metaschema.xml ./mvn-schemas-xpl.sh "$(test_metaschema)" $(output_folder) models_metaschema + +.PHONY: unit-test +unit-test: xsd-proof-test ## Generate, validate and test run an XSD for ../testing/models_metaschema.xml + + +.PHONY: xsd-proof-test +xsd-proof-test: ## Proof test XSD schema for ../testing/models_metaschema.xml + ./mvn-xsd-proofcheck-xpl.sh "$(test_metaschema)" + .PHONY: clean clean: ## Remove test output rm -fr $(output_folder)/* diff --git a/src/schema-gen/XSD/make-metaschema-xsd.xsl b/src/schema-gen/XSD/make-metaschema-xsd.xsl index 59b03f55..3d5998db 100644 --- a/src/schema-gen/XSD/make-metaschema-xsd.xsl +++ b/src/schema-gen/XSD/make-metaschema-xsd.xsl @@ -68,6 +68,8 @@ IntegerDatatype IPV4AddressDatatype IPV6AddressDatatype + MarkupLineDatatype + MarkupMultilineDatatype NonNegativeIntegerDatatype PositiveIntegerDatatype StringDatatype diff --git a/src/testing/Makefile b/src/testing/Makefile new file mode 100644 index 00000000..d9fca3dd --- /dev/null +++ b/src/testing/Makefile @@ -0,0 +1,61 @@ +include ./make_common.mk + +# TODO: Build out targets and runtimes for XML <-> JSON conversions +# Including XSpec testing of conversion pipelines and steps +# Extend and integrate unit tests into this Makefile + +# See the Makefile at ../schema-gen/InspectorXSLT/Makefile for more logic to borrow + +# INCLUDES: +# smoke-test - smoke testing - for this directory, pre-checks models_metaschema.xml +# xspec - run XSpec tests in designated folder +# clean - clean up designated output folder + +module_path:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +output_folder:=$(module_path)/test_output +xspec_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch-quiet.sh) +xspec_ci_script=$(realpath $(module_path)/../../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch.sh) +metaschema_validate_xsd_script=$(realpath $(module_path)/../validate/mvn-metaschema-xsd-validate-xpl.sh) +metaschema_validate_schematron_script=$(realpath $(module_path)/../validate/mvn-composition-validate-xpl.sh) + +folder=. +test_metaschema=models_metaschema.xml + + +.PHONY: test +test: smoke-test spec-test ## Run all tests + +# .PHONY: spec-test # +# spec-test: ## Run all specification tests +# LOGFILE="$(output_folder)/inspector-functional-tests.log" $(xspec_ci_script) \ +# "folder=$(module_path)/testing/tests/inspector-functional-xspec" \ +# "report-to=$(output_folder)/inspector-functional-tests_report.html" \ +# "junit-to=$(output_folder)/inspector-functional-tests_junit-report.xml" \ +# "stop-on-error=yes" \ +# "recurse=yes" + + +.PHONY: smoke-test +smoke-test: pre-checks ## For this directory, run pre-checks for other processes + + +.PHONY: pre-checks +pre-checks: ## Validate and check models_metaschema.xml + $(metaschema_validate_xsd_script) models_metaschema.xml + $(metaschema_validate_schematron_script) models_metaschema.xml + + +.PHONY: xspec +xspec: ## Run all *.xspec in a designated folder, quietly - use folder=[folder] + LOGFILE="$(output_folder)/$(folder)-xspec-tests.log" $(xspec_script) \ + "baseURI=file:$(module_path)/" \ + "folder=$(folder)" \ + "report-to=$(output_folder)/inspector-$(folder)-tests_report.html" \ + "stop-on-error=no" \ + "recurse=yes" + + +.PHONY: clean +clean: ## Remove test output + rm -fr $(output_folder)/* + diff --git a/src/testing/models_metaschema.xml b/src/testing/models_metaschema.xml index 0b72c8d6..4a441e7c 100644 --- a/src/testing/models_metaschema.xml +++ b/src/testing/models_metaschema.xml @@ -45,11 +45,11 @@ assembly everything. EVERYTHING + + Deprecated + a deprecated flag. + - - Deprecated - a deprecated flag. - overloaded1 diff --git a/src/testing/readme.md b/src/testing/readme.md new file mode 100644 index 00000000..245b60ce --- /dev/null +++ b/src/testing/readme.md @@ -0,0 +1,48 @@ +# Testing Resources + +See the [TESTING](../TESTING.md) docs for info on testing. + +This directory contains misc testing resources that do not have a home elsewhere, or have not yet been moved to their proper homes. + +## Warning: taking care editing resources + +The files and utilities in this subdirectory are used as inputs in testing across the repository. When editing them, be sure that dependent operations are still running. + +Don't edit and amend these resources without performing due diligence to align processes and tests that depend on them. + +## In this directory + + +Dynamic testing of Metaschema-based data conversions, XML to JSON and back. + +- models-testdata.xml +- models_metaschema.xml +- test-json-conversions.xpl +- test-xml-conversions.xpl +- test-xml-json-roundtrip.xpl + +Don't change any of these files without keeping the schema generation testing in place as it depends on them. + +## Tinydata model + +See the [tinydata](./tinydata) folder for a fully worked example, made to a different set of design requirements than models_metaschema.xml. + +It has its own tests and build scripts. + +The 'models' metaschema aims to present all assembly, field and flag model configurations and definitions in a 'lab-only' tag set. + +Tinydata, in contrast, is designed to be actually useful for some range of use cases, for example glossaries, data sheets or spreadsheet dumps. + +## Schema generation testing overhaul planning Summer 2024 + +- [ ] **Phase I** plan out, test and code solution to Issue 105 - JSON schema `choice` fail + - [x] use tinydata example to unit test this in schema-gen/JSON-schema + - [ ] demonstrate with some go/no-go testing in tinydata that this works + - [ ] make a new OSCAL catalog JSON Schema available for field testing in oscal-xproc3 + - [ ] clean up and push to address #105 +- [ ] **Phase II** build out XSpecs for schema generation - at least minimally (foothold) + - [ ] XSD and JSON Schema in detail + - [ ] both models_metaschema and tinydata +- [ ] **Phase III** Inspector XSLT generation + - [ ] free all schema generators from `metaschema` module runtime dependency + - [ ] make all schema generation available as runtimes in XSLT, XProc 1/3 diff --git a/src/testing/tinydata/TINYDATA-MAKE-JSON.xpl b/src/testing/tinydata/TINYDATA-MAKE-JSON.xpl new file mode 100644 index 00000000..1c34ed85 --- /dev/null +++ b/src/testing/tinydata/TINYDATA-MAKE-JSON.xpl @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/testing/tinydata/TINYDATA-XSD-VALIDATE.xpl b/src/testing/tinydata/TINYDATA-XSD-VALIDATE.xpl new file mode 100644 index 00000000..23e74366 --- /dev/null +++ b/src/testing/tinydata/TINYDATA-XSD-VALIDATE.xpl @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Checking { count(*/*) }{ if (count(*/*) eq 1) then ' document' else ' documents' } against a 'choices' XSD ... + + + + ALL GOOD - confirming expected results from XSD validation + + + + + + VALIDATION ANOMALY: a document expected to be valid is found to be INVALID + + + + VALIDATION ANOMALY: a marked document ('<?EXPECT ERROR?>') is found to be VALID + + + + CONFIRMED (invalid) + + + + CONFIRMED (valid) + + + + + + + + + + + + + + + + + { (1 to 12) ! ':::::' } + + + + + + + + + + : { . } + + + + + + + \ No newline at end of file diff --git a/src/testing/tinydata/current/tiny_COMPOSED.xml b/src/testing/tinydata/current/tiny_COMPOSED.xml new file mode 100644 index 00000000..2214fe8d --- /dev/null +++ b/src/testing/tinydata/current/tiny_COMPOSED.xml @@ -0,0 +1,446 @@ + + Seeing assembly#tiny:TINY, field#tiny:title, field#tiny:term, assembly#tiny:part, assembly#tiny:sheet, flag#tiny:key, flag#tiny:class, field#tiny:item, field#tiny:note + Tiny Data Model + 0.0.2 + tiny + http://csrc.nist.gov/ns/metaschema-xslt/tinydata + http://csrc.nist.gov/ns/metaschema-xslt/tinydata + +

Tiny Metaschema

+

A metaschema can be small and yet deep.

+
+ + Tiny Data + A minimally described data set. + TINY + + Tiny ID + An identifier. + + + + + + + + Stuff + Some amount of tiny stuff. + + + + + + + + + + + Title + markup-line example. + + + Term + Simple string value example. + + Term identifier + A token identifying this term uniquely within the document. + + +

For a more extensive model supporting definitions, acronyms etc. build this out into an assembly. As a field, this supports some control over the vocabulary and formatting without heavier embedded metadata.

+

Of course you could always make a structured glossary out of regular and controlled parts for your terminology, and use this inside it, potentially with title/insert.

+
+
+ + Note + Wrapped markup-multiline example. + + + Tiny part + A bit of tiny data. + + + + + + + Stuff + Some amount of tiny stuff. + + + + + + + + + + + + Tiny sheet + A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + + + + + + Stuff + Some amount of tiny stuff. + + + + entry + + + + item + + + + + + + + Line item + A value, potentially marked with @key or @class. + + + + N (position) + An indexed position (distinctive among values of parent::*/*/@n). + + + + Distinctive 'n' value + @n must be distinctive among sibling items. + +

A whole number is expected here although '0' is permitted. Values among siblings are not constrained to be ordered, only different. Ordering is up to the receiving application.

+
+
+
+ +

An application may constrain the value of the node to a datatype or other requirement, on the basis of @key, @class or other association(s).

+
+
+ + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + + + Class + Class or classes. + +
diff --git a/src/testing/tinydata/current/tiny_inspector.xsl b/src/testing/tinydata/current/tiny_inspector.xsl new file mode 100644 index 00000000..5acdeb58 --- /dev/null +++ b/src/testing/tinydata/current/tiny_inspector.xsl @@ -0,0 +1,1048 @@ + + + + + + + + inspected + + full + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + av.152 + _UE unmatched-element + Unrecognized element { name() }. + + + + + + + + + + + + + + av.180 + _UT unexpected-text + Errant text content. + + + + + + + av.193 + _UA unmatched-attribute + Unrecognized attribute @{ name() } on element { name(..) }. + + + + + + + + + + exists(.) + + __U uncategorized + * + [info] + ERROR + + + + + + + + + + + + + + + + + + [info] + + + + + + + + + /{ name() } + + + + + /{ name() }[{ mx:element-position(.)[count($kin) gt 1] }] + + + + /@{ name() } + + + + + [{ count(preceding-sibling::text()|.) }] + /text(){ (count($kin)[. gt 1]) ! $place } + + + + + [{ count(preceding-sibling::comment()|.) }] + /text(){ (count($kin)[. gt 1]) ! $place } + + + + + [{ count(preceding-sibling::processing-instruction()|.) + }] + /text(){ (count($kin)[. gt 1]) ! $place } + + + + + + + + + + + { $as } + { $as }s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File { replace(@src,'.*/','') } has { $error-count } { + mx:pluralize($error-count,'error')}. + File { replace(@src,'.*/','') } has { $report-count } { + mx:pluralize($report-count,'issue') } reported including { $error-count } { + mx:pluralize($error-count,'error')}. + + + + + + + + + + File { replace(@src,'.*/','') } is reported VALID, no issues ... + + + + + + + + + + + + + + + + + + + + + + + + + { (@level,'ERROR')[1] } [CLASS) { @class } ][PATH) { @xpath } ][REPORT) { + string(.) }] + + + + + + + + + + + + { $validating-filename } - { $checked } - { mx:metaschema/@shortname } validation + + + + + + +
+ + +

+ { $validating-filename } contains { @elements} { + mx:pluralize(@elements/number(),'element') } and { @attributes } { + mx:pluralize(@attributes/number(),'attribute') }.

+ + +
+ +
+
+
+ + + + + + + + + +
+

{ count(.//mx:report) } { mx:pluralize(count(.//mx:report),'issue') } reported.

+

+ + 💥 + +

+
+
+ +
+

Good news - nothing to report - the instance is valid. 🚀 +

+
+
+ + + + +
+ + + +

{ @class }{ @level[not(.='ERROR')] ! (' ' || .) }

+
    + +
  • Rule ID: { . } +
  • +
    +
  • test: { @test } +
  • + +
  • matching: { @matching } +
  • +
    +
  • XPath: { @xpath } +
  • +
+
+
+ + + + + + + + + + + + + + + + + { codepoints-to-string(10) } + + + + + + + { $lf } + + + + { $lf2 }--- + + + + # + + + + + { $lf2 }# + + + + + { $lf2 }## + + + + + { $lf2 }### + + + + + { $lf2 } + + + + + + + + + { $lf }- + + + + ** + + ** + + + * + + * + + + ` + + ` + + + Tiny Data Model + + + + + + + + + + + + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::notes) + + Element part is unexpected following notes/note. + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::sheet | preceding-sibling::note) + + Element part is unexpected following sheet or note. + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::note) + + Element sheet is unexpected following note. + + + + + + + + gix.362 + empty(preceding-sibling::entry) and exists(../(item)) + + VEXC violates-exclusive-choice + Element entry is unexpected along with item. + + + + + + + + + gix.347 + EATO element-appears-too-often + count(. | preceding-sibling::title) gt 1 + + Element title appears too many times: 1 maximum is permitted. + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following term, stuff, part, or notes/note. + + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element term is unexpected following stuff, part, or notes/note. + + + + + + + + + + + + + + + + gix.347 + EATO element-appears-too-often + count(. | preceding-sibling::title) gt 1 + + Element title appears too many times: 1 maximum is permitted. + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::sheet | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following term, stuff, part, sheet, or note. + + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::part | preceding-sibling::sheet | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element term is unexpected following stuff, part, sheet, or note. + + + + + + + + + gix.347 + EATO element-appears-too-often + count(. | preceding-sibling::note) gt 1 + + Element note appears too many times: 1 maximum is permitted. + + + + + + + + + gix.347 + EATO element-appears-too-often + count(. | preceding-sibling::title) gt 1 + + Element title appears too many times: 1 maximum is permitted. + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::entry | preceding-sibling::item | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following stuff, entry, item, or note. + + + + + + + + + gix.362 + empty(preceding-sibling::item) and exists(../(entry)) + + VEXC violates-exclusive-choice + Element item is unexpected along with entry. + + + + + + + + + gix.347 + EATO element-appears-too-often + count(. | preceding-sibling::note) gt 1 + + Element note appears too many times: 1 maximum is permitted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gix.108 + EOOP element-out-of-place + Element { name() } is not permitted here. + + + + + gix.117 + AOOP attribute-out-of-place + Attribute @{ name() } is not permitted here. + + + + + + + + gix.748 + MRQA missing-required-attribute + empty(@id) + + Element { name() } requires attribute @id. + + + gix.445 + MRQC missing-required-contents + empty(title) + + Element { name() } requires element title. + + + + + + + + + + + + + + gix.748 + MRQA missing-required-attribute + empty(@id) + + Element { name() } requires attribute @id. + + + + + + + + + + + + gix.445 + MRQC missing-required-contents + empty(title) + + Element { name() } requires element title. + + + + + + + + + + + + + + + + + + + + + + + + + + + VDSX violates-datatype-syntax + + + gix.148 + + + { $class } + not(string(.) castable as xs:string and matches(.,'^\S(.*\S)?$')) + + Value { string(.) } of { if (self::element()) then 'element' else 'attribute' } { self::attribute()/'@' }{ name(.) } does not conform to string datatype. + + + + + VDSX violates-datatype-syntax + + + gix.148 + + + { $class } + not(string(.) castable as xs:string and matches(.,'^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$') and matches(.,'^\S(.*\S)?$')) + + Value { string(.) } of { if (self::element()) then 'element' else 'attribute' } { self::attribute()/'@' }{ name(.) } does not conform to token datatype. + + + + + VDSX violates-datatype-syntax + + + gix.148 + + + { $class } + not(string(.) castable as xs:nonNegativeInteger and matches(.,'^\S(.*\S)?$')) + + Value { string(.) } of { if (self::element()) then 'element' else 'attribute' } { self::attribute()/'@' }{ name(.) } does not conform to non-negative-integer datatype. + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::part | preceding-sibling::notes) + + Element stuff is unexpected following part or notes/note. + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::part | preceding-sibling::sheet | preceding-sibling::note) + + Element stuff is unexpected following part, sheet, or note. + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::entry | preceding-sibling::item | preceding-sibling::note) + + Element stuff is unexpected following entry, item, or note. + + + + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::notes | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following term, stuff, part, or notes/note. + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::term | preceding-sibling::part | preceding-sibling::sheet | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following term, stuff, part, sheet, or note. + + + + + gix.390 + EOOO element-out-of-order + exists(preceding-sibling::entry | preceding-sibling::item | preceding-sibling::note | preceding-sibling::h1 | preceding-sibling::h2 | preceding-sibling::h3 | preceding-sibling::h4 | preceding-sibling::h5 | preceding-sibling::h6 | preceding-sibling::table | preceding-sibling::img | preceding-sibling::pre | preceding-sibling::hr | preceding-sibling::blockquote | preceding-sibling::ul | preceding-sibling::ol | preceding-sibling::p) + + Element title is unexpected following stuff, entry, item, or note. + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/testing/tinydata/current/tiny_json-schema.xml b/src/testing/tinydata/current/tiny_json-schema.xml new file mode 100644 index 00000000..7fc22741 --- /dev/null +++ b/src/testing/tinydata/current/tiny_json-schema.xml @@ -0,0 +1,346 @@ + + http://json-schema.org/draft-07/schema# + http://csrc.nist.gov/ns/metaschema-xslt/tinydata/0.0.2/tiny-schema.json + Tiny Data Model: JSON Schema + object + + + Schema Directive + A JSON Schema directive to bind a specific schema to its document instance. + #/definitions/json-schema-directive + #/definitions/URIReferenceDatatype + + + Tiny Data + A minimally described data set. + #/definitions/tiny-tiny:TINY + object + + + Tiny ID + An identifier. + #/definitions/TokenDatatype + + + #/definitions/tiny-tiny:title + + + + + #/definitions/tiny-tiny:term + + + array + 1 + + #/definitions/tiny-tiny:term + + + + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:part + + + array + 1 + + #/definitions/tiny-tiny:part + + + + + + + + #/definitions/tiny-tiny:note + + + array + 1 + + #/definitions/tiny-tiny:note + + + + + + + id + title + + false + + + Title + markup-line example. + #/definitions/tiny-tiny:title + #/definitions/MarkupLineDatatype + + + Term + Simple string value example. + #/definitions/tiny-tiny:term + object + + + Term identifier + A token identifying this term uniquely within the document. + #/definitions/TokenDatatype + + + #/definitions/StringDatatype + + + + STRVALUE + id + + false + + + Note + Wrapped markup-multiline example. + #/definitions/tiny-tiny:note + #/definitions/MarkupMultilineDatatype + + + Tiny part + A bit of tiny data. + #/definitions/tiny-tiny:part + object + + + #/definitions/tiny-tiny:title + + + + + #/definitions/tiny-tiny:term + + + array + 1 + + #/definitions/tiny-tiny:term + + + + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:part + + + array + 1 + + #/definitions/tiny-tiny:part + + + + + + + + #/definitions/tiny-tiny:sheet + + + array + 1 + + #/definitions/tiny-tiny:sheet + + + + + + #/definitions/tiny-tiny:note + + + + title + + false + + + Tiny sheet + A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + #/definitions/tiny-tiny:sheet + object + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + #/definitions/tiny-tiny:title + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + array + 1 + + #/definitions/tiny-tiny:sheet + + + + #/definitions/tiny-tiny:note + + + false + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + #/definitions/tiny-tiny:title + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:item + + + array + 1 + + #/definitions/tiny-tiny:item + + + + + + #/definitions/tiny-tiny:note + + + false + + + + + Line item + A value, potentially marked with @key or @class. + #/definitions/tiny-tiny:item + object + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + N (position) + An indexed position (distinctive among values of parent::*/*/@n). + #/definitions/NonNegativeIntegerDatatype + + + #/definitions/MarkupLineDatatype + + + + RICHTEXT + + false + + + A whole number value. + integer + + + A single line of Markdown content conformant to the Commonmark specification. + string + ^[^ +]+$ + + + A multiple lines of Markdown content conformant to the Commonmark specification. + string + + + An integer value that is equal to or greater than 0. + + + #/definitions/IntegerDatatype + + + number + 0 + + + + + A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ + ]+ + string + ^\S(.*\S)?$ + + + A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName. + string + ^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$ + + + A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986. + string + uri-reference + + + + + #/definitions/json-schema-directive + + + #/definitions/tiny-tiny:TINY + + + + TINY + + false + diff --git a/src/testing/tinydata/current/tiny_json-to-xml.xsl b/src/testing/tinydata/current/tiny_json-to-xml.xsl new file mode 100644 index 00000000..c5c5902e --- /dev/null +++ b/src/testing/tinydata/current/tiny_json-to-xml.xsl @@ -0,0 +1,780 @@ + + + + + + + + + + xml + + + No file found at { $file } + + + + + + + {{ $err:description }} + + + + + + + {{ $err:description }} + + + + + + + + + + + + Error in XSLT invocation - an initial template (-it) is expected ('from-json' or 'from-xdm-json-xml'), but none is given + + + + + + + + { $err:description } + + + + + + + + + + No XPath (XML) JSON found at { $file } - using syntax of http://www.w3.org/2005/xpath-functions + + + + + + + + + + + + + + + + + + + + + + + + + http://example.com/ns/tinydata + + + + + + TINY + + + + + + + + + + + + + + + + + + part + + + + + + + + + + + + + + + sheet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + title + + + + + + + + + + + + + + + term + + + + + + + + + + + + + + + + + items + + + + + + + + + + + + + + + + + + + note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + +

+
+
+ + + + + + + + + + + + + + + + +
+ + + + + + + +
+         
+            language-{.}
+         
+         
+      
+
+ + +

+ + +

+
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +

+ +

+
+ ^\s*(\*|\d+\.)\s + + + +
  • + + +
    +
    + +
    +
  • +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
  • + + + + + + + + +
  • +
    + + +
  • + + + + + +
  • +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &amp; + &lt; + + &quot; + + &#x2A; + &#x60; + &#x7E; + &#x5E; + + + + + + + + + + + + + + + + + + + "" + !\[{{$noclosebracket}}\] + \{\{\s*insert: ,\s*\s*\}\} + \(\) + `` + + \*\*\*\*\*\* + + \*\*\*\* + \*\* + ~~ + \^\^ + + + + + + + + + + + + + + + + (.*?) + + + (\i\c*?) + + + ([^{ @not }]*?) + + + + < + + + xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0/supermodel" + + + > + + </ + + > + + + $1 + + + + <insert xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0/supermodel" + + + /> + + + type='$1' + + + id-ref='$2' + + + href='$2' + + + + alt='$1' + + + + src='$2' + + + { insertion } + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/testing/tinydata/current/tiny_schema.json b/src/testing/tinydata/current/tiny_schema.json new file mode 100644 index 00000000..3f72fb10 --- /dev/null +++ b/src/testing/tinydata/current/tiny_schema.json @@ -0,0 +1,247 @@ + + { "$schema" : "http://json-schema.org/draft-07/schema#", + "$id" : "http://csrc.nist.gov/ns/metaschema-xslt/tinydata/0.0.2/tiny-schema.json", + "$comment" : "Tiny Data Model: JSON Schema", + "type" : "object", + "definitions" : + { "json-schema-directive" : + { "title" : "Schema Directive", + "description" : "A JSON Schema directive to bind a specific schema to its document instance.", + "$id" : "#/definitions/json-schema-directive", + "$ref" : "#/definitions/URIReferenceDatatype" }, + "tiny-tiny:TINY" : + { "title" : "Tiny Data", + "description" : "A minimally described data set.", + "$id" : "#/definitions/tiny-tiny:TINY", + "type" : "object", + "properties" : + { "id" : + { "title" : "Tiny ID", + "description" : "An identifier.", + "$ref" : "#/definitions/TokenDatatype" }, + "title" : + { "$ref" : "#/definitions/tiny-tiny:title" }, + "terminology" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:term" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:term" } } ] }, + "stuff" : + { "title" : "Stuff", + "description" : "Some amount of tiny stuff.", + "$ref" : "#/definitions/MarkupMultilineDatatype" }, + "parts" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:part" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:part" } } ] }, + "notes" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:note" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:note" } } ] } }, + "required" : + [ "id", + "title" ], + "additionalProperties" : false }, + "tiny-tiny:title" : + { "title" : "Title", + "description" : "markup-line example.", + "$id" : "#/definitions/tiny-tiny:title", + "$ref" : "#/definitions/MarkupLineDatatype" }, + "tiny-tiny:term" : + { "title" : "Term", + "description" : "Simple string value example.", + "$id" : "#/definitions/tiny-tiny:term", + "type" : "object", + "properties" : + { "id" : + { "title" : "Term identifier", + "description" : "A token identifying this term uniquely within the document.", + "$ref" : "#/definitions/TokenDatatype" }, + "STRVALUE" : + { "$ref" : "#/definitions/StringDatatype" } }, + "required" : + [ "STRVALUE", + "id" ], + "additionalProperties" : false }, + "tiny-tiny:note" : + { "title" : "Note", + "description" : "Wrapped markup-multiline example.", + "$id" : "#/definitions/tiny-tiny:note", + "$ref" : "#/definitions/MarkupMultilineDatatype" }, + "tiny-tiny:part" : + { "title" : "Tiny part", + "description" : "A bit of tiny data.", + "$id" : "#/definitions/tiny-tiny:part", + "type" : "object", + "properties" : + { "title" : + { "$ref" : "#/definitions/tiny-tiny:title" }, + "terminology" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:term" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:term" } } ] }, + "stuff" : + { "title" : "Stuff", + "description" : "Some amount of tiny stuff.", + "$ref" : "#/definitions/MarkupMultilineDatatype" }, + "parts" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:part" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:part" } } ] }, + "sheets" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:sheet" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:sheet" } } ] }, + "note" : + { "$ref" : "#/definitions/tiny-tiny:note" } }, + "required" : + [ "title" ], + "additionalProperties" : false }, + "tiny-tiny:sheet" : + { "title" : "Tiny sheet", + "description" : "A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid.", + "$id" : "#/definitions/tiny-tiny:sheet", + "type" : "object", + "anyOf" : + [ + { "properties" : + { "key" : + { "title" : "Field key", + "description" : "Distinguishing a sheet or item (field) among siblings or neighbors.", + "$ref" : "#/definitions/TokenDatatype" }, + "class" : + { "title" : "Class", + "description" : "Class or classes.", + "$ref" : "#/definitions/StringDatatype" }, + "title" : + { "$ref" : "#/definitions/tiny-tiny:title" }, + "stuff" : + { "title" : "Stuff", + "description" : "Some amount of tiny stuff.", + "$ref" : "#/definitions/MarkupMultilineDatatype" }, + "sheets" : + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:sheet" } }, + "note" : + { "$ref" : "#/definitions/tiny-tiny:note" } }, + "additionalProperties" : false }, + + { "properties" : + { "key" : + { "title" : "Field key", + "description" : "Distinguishing a sheet or item (field) among siblings or neighbors.", + "$ref" : "#/definitions/TokenDatatype" }, + "class" : + { "title" : "Class", + "description" : "Class or classes.", + "$ref" : "#/definitions/StringDatatype" }, + "title" : + { "$ref" : "#/definitions/tiny-tiny:title" }, + "stuff" : + { "title" : "Stuff", + "description" : "Some amount of tiny stuff.", + "$ref" : "#/definitions/MarkupMultilineDatatype" }, + "items" : + { "anyOf" : + [ + { "$ref" : "#/definitions/tiny-tiny:item" }, + + { "type" : "array", + "minItems" : 1, + "items" : + { "$ref" : "#/definitions/tiny-tiny:item" } } ] }, + "note" : + { "$ref" : "#/definitions/tiny-tiny:note" } }, + "additionalProperties" : false } ] }, + "tiny-tiny:item" : + { "title" : "Line item", + "description" : "A value, potentially marked with @key or @class.", + "$id" : "#/definitions/tiny-tiny:item", + "type" : "object", + "properties" : + { "key" : + { "title" : "Field key", + "description" : "Distinguishing a sheet or item (field) among siblings or neighbors.", + "$ref" : "#/definitions/TokenDatatype" }, + "class" : + { "title" : "Class", + "description" : "Class or classes.", + "$ref" : "#/definitions/StringDatatype" }, + "n" : + { "title" : "N (position)", + "description" : "An indexed position (distinctive among values of parent::*/*/@n).", + "$ref" : "#/definitions/NonNegativeIntegerDatatype" }, + "RICHTEXT" : + { "$ref" : "#/definitions/MarkupLineDatatype" } }, + "required" : + [ "RICHTEXT" ], + "additionalProperties" : false }, + "IntegerDatatype" : + { "description" : "A whole number value.", + "type" : "integer" }, + "MarkupLineDatatype" : + { "description" : "A single line of Markdown content conformant to the Commonmark specification.", + "type" : "string", + "pattern" : "^[^\n]+$" }, + "MarkupMultilineDatatype" : + { "description" : "A multiple lines of Markdown content conformant to the Commonmark specification.", + "type" : "string" }, + "NonNegativeIntegerDatatype" : + { "description" : "An integer value that is equal to or greater than 0.", + "allOf" : + [ + { "$ref" : "#/definitions/IntegerDatatype" }, + + { "type" : "number", + "minimum" : 0 } ] }, + "StringDatatype" : + { "description" : "A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+", + "type" : "string", + "pattern" : "^\\S(.*\\S)?$" }, + "TokenDatatype" : + { "description" : "A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName.", + "type" : "string", + "pattern" : "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" }, + "URIReferenceDatatype" : + { "description" : "A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986.", + "type" : "string", + "format" : "uri-reference" } }, + "properties" : + { "$schema" : + { "$ref" : "#/definitions/json-schema-directive" }, + "TINY" : + { "$ref" : "#/definitions/tiny-tiny:TINY" } }, + "required" : + [ "TINY" ], + "additionalProperties" : false } \ No newline at end of file diff --git a/src/testing/tinydata/current/tiny_schema.xsd b/src/testing/tinydata/current/tiny_schema.xsd new file mode 100644 index 00000000..0fa3bbe5 --- /dev/null +++ b/src/testing/tinydata/current/tiny_schema.xsd @@ -0,0 +1,498 @@ + + + + Tiny Data Model + 0.0.2 + tiny + +

    Tiny Metaschema

    +

    A metaschema can be small and yet deep.

    +
    + TINY +
    +
    + + + + + Tiny Data + A minimally described data set. + + + Tiny Data: A minimally described data set. + + + + + + + + + + + + + Note + Wrapped markup-multiline example. + + + Note: Wrapped markup-multiline example. + + + + + + + + + + + + + Tiny ID + An identifier. + + + Tiny ID: An identifier. + + + + + + + Title + markup-line example. + + + Title: markup-line example. + + + + + + + + + Term + Simple string value example. + + + Term: Simple string value example. + + + + + + + Term identifier + A token identifying this term uniquely within the document. + + + Term identifier: A token identifying this term uniquely within the document. + + + + + + + + + Note + Wrapped markup-multiline example. + + + Note: Wrapped markup-multiline example. + + + + + + + + + Tiny part + A bit of tiny data. + + + Tiny part: A bit of tiny data. + + + + + + + + + + + Note + Wrapped markup-multiline example. + + + Note: Wrapped markup-multiline example. + + + + + + + + + + + Tiny sheet + A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + + + Tiny sheet: A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + + + + + + + + + + + + Note + Wrapped markup-multiline example. + + + Note: Wrapped markup-multiline example. + + + + + + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + + + Field key: Distinguishing a sheet or item (field) among siblings or neighbors. + + + + + + Class + Class or classes. + + + Class: Class or classes. + + + + + + + Line item + A value, potentially marked with @key or @class. + + + Line item: A value, potentially marked with @key or @class. + + + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + + + Field key: Distinguishing a sheet or item (field) among siblings or neighbors. + + + + + + Class + Class or classes. + + + Class: Class or classes. + + + + + + N (position) + An indexed position (distinctive among values of parent::*/*/@n). + + + N (position): An indexed position (distinctive among values of parent::*/*/@n). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The content model is the same as inlineMarkupType, but line endings need + to be preserved, since this is pre-formatted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + + + + + An integer value that is equal to or greater than 0. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + A non-empty string of Unicode characters with leading and trailing whitespace + disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+ + + + + The 'string' datatype restricts the XSD type by prohibiting leading + and trailing whitespace, and something (not only whitespace) is required. + + + + + This pattern ensures that leading and trailing whitespace is + disallowed. This helps to even the user experience between implementations + related to whitespace. + + + + + + + + A non-empty, non-colonized name as defined by XML Schema Part 2: Datatypes + Second Edition (https://www.w3.org/TR/xmlschema11-2/#NCName), with leading and trailing + whitespace disallowed. + + + + + + A single token may not contain whitespace. + + + + + +
    diff --git a/src/testing/tinydata/current/tiny_xml-to-json.xsl b/src/testing/tinydata/current/tiny_xml-to-json.xsl new file mode 100644 index 00000000..b63a218e --- /dev/null +++ b/src/testing/tinydata/current/tiny_xml-to-json.xsl @@ -0,0 +1,755 @@ + + + + + + + json + no + + + + + + + + + + + + + + + { $err:description } + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $err:description } + + + + + + + + + + + + + + + + + + http://example.com/ns/tinydata + + + + + TINY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + part + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sheet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + title + + + + + + + + + + + term + + + + + + + + + + + + items + + + + + + + + + + + + + + note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + ## + ### + #### + ##### + ###### + + + + + + + + + + + | + + --- | + + + + + + | + + + | + + + + ``` + + + + ``` + + + + + + + + + + + + + + + * + + + + + + + + + 1. + + + + + ` + + ` + + + * + + * + + + ** + + ** + + + " + + " + + + {{ insert: + + }} + + + [ + + ] + ( + + ) + + + ![ + + ] + ( + + + "{.}" + + ) + + diff --git a/src/testing/tinydata/readme.md b/src/testing/tinydata/readme.md new file mode 100644 index 00000000..8e86fa5c --- /dev/null +++ b/src/testing/tinydata/readme.md @@ -0,0 +1,62 @@ +# Tiny Data Example Metaschema + +Purpose: An illustrative metaschema for testing + +Meant to be complementary to other testing Metaschemas for example the 'Everything' or 'computer model' metaschemas. + +Aims: + +- Be lightweight, tractable and intelligible +- Be actually albeit hypothetically useful i.e. be plausible & 'realistic' - more than a toy +- Illustrate basic (but not advanced) Metaschema functionality +- Illustrate core concepts including + - Recursive assemblies + - Mixing prose with structure + - both `markup-line` and `markup-multiline` datatypes + - Key-based text expansion (**insert/@ref-id**) + - Data dumps + - Layered constraints? + +## Basic model + +TinyData provides a simple model suitable for glossaries, dictionaries and similar structured prose, supplemented with a general-purpose "grid" or data-dump model. + +It is suitable for high-level structured documentation. But also for what might be CSV, JSON, or HTML tables. Also suitable for documents with islands of structure, or structures with islands of documentation. + +Functional semantics provided for include indexing and reasonably decent formatting for reuse, as HTML and Markdown among other formats. + +But the entire markup language has no more than ten or fifteen tags (depending on how you count). + +Meanwhile we get XSD, JSON Schemas, converters and other utilities (InspectorXSLT) to play with. + +Since it is straightforward to map a [Metaschema-based](https://github.com/usnistgov/metaschema) format into another Metaschema-based format, producing OSCAL (for example) from TinyData ought to be an instructive if elementary exercise. + +## dev punchlist + +Addressing https://github.com/usnistgov/metaschema-xslt/issues/105 + +But also leaving this resource intact for later use + +- Copy scripting over from ../issue105/ +- Refresh validators: XSD, JSON Schema and InspectorXSLT + - leave XProc in place for later use +- Validate `choice` use case + - field test this against samples (good vs broken) + - demonstrate XSD, JSON Schema *and InspectorXSLT* + - XSpec JSON Schema correction in ../../src/schema-gen/JSON-schema/ +- Assess issue with datatype handling + - are markup-line and markup-multiline adequately handled + - https://github.com/usnistgov/OSCAL/issues/2007 + - also sketch this out in XSpec +- Build out solution + - using ../../src/schema-gen/JSON-schema/choice-split.xsl + +- Makefile - `run tests` should include + - XSpecs over in ../../src + - field testing JSON and XSD validations of TinyData? (maybe not) +- Utilities? + - XSLT for TinyData making HTML + - Markdown? + - CSS for editor or browser + +Further: build out TinyData examples \ No newline at end of file diff --git a/src/testing/tinydata/refresh-tiny-converters.sh b/src/testing/tinydata/refresh-tiny-converters.sh new file mode 100644 index 00000000..269fb621 --- /dev/null +++ b/src/testing/tinydata/refresh-tiny-converters.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../common/subcommand_common.bash" + +usage() { + cat <&2 + rm -f "$XJ_CONVERTER" +fi + +if [ -e "$JX_CONVERTER" ]; then + echo "Overwriting prior $JX_CONVERTER..." >&2 + rm -f "$JX_CONVERTER" +fi + +invoke_calabash "${CALABASH_ARGS}" + +if [ -e "$XJ_CONVERTER" ] && [ -e "$JX_CONVERTER" ]; then + echo "Wrote fresh XML/JSON conversion XSLTs into ${OUTPUT_DIR}" >&2 +fi + +fi diff --git a/src/testing/tinydata/refresh-tiny-schemas.sh b/src/testing/tinydata/refresh-tiny-schemas.sh new file mode 100644 index 00000000..8bf3ab2e --- /dev/null +++ b/src/testing/tinydata/refresh-tiny-schemas.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../common/subcommand_common.bash" + +usage() { + cat <&2 + rm -f "$COMPOSED_METASCHEMA" +fi + +if [ -e "$XSD_FILE" ]; then + echo "Overwriting prior $XSD_FILE..." >&2 + rm -f "$XSD_FILE" +fi + +if [ -e "$JSONSCHEMA_FILE" ]; then + echo "Overwriting prior $JSONSCHEMA_FILE..." >&2 + rm -f "$JSONSCHEMA_FILE" +fi + +if [ -e "$JSONSCHEMA_XMLFILE" ]; then + echo "Overwriting prior $JSONSCHEMA_XMLFILE..." >&2 + rm -f "$JSONSCHEMA_XMLFILE" +fi + +if [ -e "$INSPECTORXSLT_FILE" ]; then + echo "Overwriting prior $INSPECTORXSLT_FILE..." >&2 + rm -f "$INSPECTORXSLT_FILE" +fi + + +# echo "${CALABASH_ARGS}" + +invoke_calabash "${CALABASH_ARGS}" + +if [ -e "$XSD_FILE" ] && [ -e "$JSONSCHEMA_FILE" ] && [ -e "$INSPECTORXSLT_FILE" ]; then + echo "Wrote composed metaschema (de-referenced input) to $COMPOSED_METASCHEMA" >&2 + echo "Wrote XSD to $XSD_FILE" >&2 + echo "Wrote JSON schema to $JSONSCHEMA_FILE" >&2 + echo "Wrote JSON schema (XML notation) to $JSONSCHEMA_XMLFILE" >&2 + echo "Wrote Inspector XSLT to $INSPECTORXSLT_FILE" >&2 +fi + +fi diff --git a/src/testing/tinydata/tiny-data/bigbadtiny.xml b/src/testing/tinydata/tiny-data/bigbadtiny.xml new file mode 100644 index 00000000..71e83693 --- /dev/null +++ b/src/testing/tinydata/tiny-data/bigbadtiny.xml @@ -0,0 +1,30 @@ + + + Big Bad Tiny Data +

    A tiny data example sheet.

    +

    Find examples of both valid and invalid markup-line and markup-multiline in a pretend operational context.

    + + Some valid data +

    Here's some okay markup multiline, all clear.

    +

    A markup zoo permits all kinds of inline markup including bold, strong, italic, emphasis, code, subscript, superscript, hypertext anchors, and img alt-text for file.jpg (insertion points and images)

    + + Valid structures +

    Including:

    +
      +
    • lists
    • +
    • tables
    • +
    • preformatted blocks
    • +
    • block quotes
    • +
    +
    + + Here's a data sheet + + a + b + + +
    +
    diff --git a/src/testing/tinydata/tiny-data/tiny1.xml b/src/testing/tinydata/tiny-data/tiny1.xml new file mode 100644 index 00000000..5fb5c1f0 --- /dev/null +++ b/src/testing/tinydata/tiny-data/tiny1.xml @@ -0,0 +1,22 @@ + + + Hello World + + Part First + + Some part +

    Some parting words.

    +
    + +

    Take note here.

    +
    +
    + + +

    An endnote, with emphasis.

    +
    +
    +
    \ No newline at end of file diff --git a/src/testing/tinydata/tiny-json-validate-xp3.sh b/src/testing/tinydata/tiny-json-validate-xp3.sh new file mode 100644 index 00000000..17a5ae92 --- /dev/null +++ b/src/testing/tinydata/tiny-json-validate-xp3.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../common/subcommand_common.bash" + +usage() { + cat < + http://json-schema.org/draft-07/schema# + http://csrc.nist.gov/ns/metaschema-xslt/tinydata/0.0.2/tiny-schema.json + Tiny Data Model: JSON Schema + object + + + Schema Directive + A JSON Schema directive to bind a specific schema to its document instance. + #/definitions/json-schema-directive + #/definitions/URIReferenceDatatype + + + Tiny Data + A minimally described data set. + #/definitions/tiny-tiny:TINY + object + + + Tiny ID + An identifier. + #/definitions/TokenDatatype + + + #/definitions/tiny-tiny:title + + + + + #/definitions/tiny-tiny:term + + + array + 1 + + #/definitions/tiny-tiny:term + + + + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:part + + + array + 1 + + #/definitions/tiny-tiny:part + + + + + + + + #/definitions/tiny-tiny:note + + + array + 1 + + #/definitions/tiny-tiny:note + + + + + + + id + title + + false + + + Title + markup-line example. + #/definitions/tiny-tiny:title + #/definitions/MarkupLineDatatype + + + Term + Simple string value example. + #/definitions/tiny-tiny:term + object + + + Term identifier + A token identifying this term uniquely within the document. + #/definitions/TokenDatatype + + + #/definitions/StringDatatype + + + + STRVALUE + id + + false + + + Note + Wrapped markup-multiline example. + #/definitions/tiny-tiny:note + #/definitions/MarkupMultilineDatatype + + + Tiny part + A bit of tiny data. + #/definitions/tiny-tiny:part + object + + + #/definitions/tiny-tiny:title + + + + + #/definitions/tiny-tiny:term + + + array + 1 + + #/definitions/tiny-tiny:term + + + + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:part + + + array + 1 + + #/definitions/tiny-tiny:part + + + + + + + + #/definitions/tiny-tiny:sheet + + + array + 1 + + #/definitions/tiny-tiny:sheet + + + + + + #/definitions/tiny-tiny:note + + + + title + + false + + + Tiny sheet + A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + #/definitions/tiny-tiny:sheet + object + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + #/definitions/tiny-tiny:title + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + array + 1 + + #/definitions/tiny-tiny:sheet + + + + #/definitions/tiny-tiny:note + + + false + + + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + #/definitions/tiny-tiny:title + + + Stuff + Some amount of tiny stuff. + #/definitions/MarkupMultilineDatatype + + + + + #/definitions/tiny-tiny:item + + + array + 1 + + #/definitions/tiny-tiny:item + + + + + + #/definitions/tiny-tiny:note + + + false + + + + + Line item + A value, potentially marked with @key or @class. + #/definitions/tiny-tiny:item + object + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + #/definitions/TokenDatatype + + + Class + Class or classes. + #/definitions/StringDatatype + + + N (position) + An indexed position (distinctive among values of parent::*/*/@n). + #/definitions/NonNegativeIntegerDatatype + + + #/definitions/MarkupLineDatatype + + + + RICHTEXT + + false + + + A whole number value. + integer + + + A single line of Markdown content conformant to the Commonmark specification. + string + ^[^ +]+$ + + + A multiple lines of Markdown content conformant to the Commonmark specification. + string + + + An integer value that is equal to or greater than 0. + + + #/definitions/IntegerDatatype + + + number + 0 + + + + + A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ + ]+ + string + ^\S(.*\S)?$ + + + A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName. + string + ^(\p{L}|_)(\p{L}|\p{N}|[.\-_])*$ + + + A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986. + string + uri-reference + + + + + #/definitions/json-schema-directive + + + #/definitions/tiny-tiny:TINY + + + + TINY + + false + diff --git a/src/testing/tinydata/tiny_metaschema.xml b/src/testing/tinydata/tiny_metaschema.xml new file mode 100644 index 00000000..359dfd58 --- /dev/null +++ b/src/testing/tinydata/tiny_metaschema.xml @@ -0,0 +1,161 @@ + + + Tiny Data Model + 0.0.2 + tiny + http://csrc.nist.gov/ns/metaschema-xslt/tinydata + http://csrc.nist.gov/ns/metaschema-xslt/tinydata + + + + +

    Tiny Metaschema

    +

    A metaschema can be small and yet deep.

    +
    + + + Tiny Data + A minimally described data set. + TINY + + Tiny ID + An identifier. + + + + + + + + Stuff + Some amount of tiny stuff. + + + + + + + + + + + + Title + markup-line example. + + + + Term + Simple string value example. + + Term identifier + A token identifying this term uniquely within the document. + + +

    For a more extensive model supporting definitions, acronyms etc. build this out into an assembly. + As a field, this supports some control over the vocabulary and formatting without heavier embedded metadata.

    +

    Of course you could always make a structured glossary out of regular and controlled parts for your terminology, and use this inside it, potentially with title/insert.

    +
    +
    + + + Note + Wrapped markup-multiline example. + + + + Tiny part + A bit of tiny data. + + + + + + + Stuff + Some amount of tiny stuff. + + + + + + + + + + + + + Tiny sheet + A list or grid of data points (items), or an entry (row or line item) in such a list or grid that contains such a list or grid. + + + + + + + + Stuff + Some amount of tiny stuff. + + + + entry + + + + + item + + + + + + + + + Line item + A value, potentially marked with @key or @class. + + + + N (position) + An indexed position (distinctive among values of parent::*/*/@n). + + + + Distinctive 'n' value + @n must be distinctive among sibling items. + +

    A whole number is expected here although '0' is permitted. Values among siblings are not constrained to be ordered, only different. Ordering is up to the receiving application.

    +
    +
    +
    +

    An application may constrain the value of the node to a datatype or other requirement, on the basis of @key, @class or other association(s).

    +
    + + + Field key + Distinguishing a sheet or item (field) among siblings or neighbors. + + + + Class + Class or classes. + + +
    diff --git a/src/testing/tinydata/tinydata_xml-converter.xsl b/src/testing/tinydata/tinydata_xml-converter.xsl new file mode 100644 index 00000000..8ae7ca90 --- /dev/null +++ b/src/testing/tinydata/tinydata_xml-converter.xsl @@ -0,0 +1,17 @@ + + + + + + + yes + + + + + + + diff --git a/src/testing/tinydata/validate-tiny-json.xp3 b/src/testing/tinydata/validate-tiny-json.xp3 new file mode 100644 index 00000000..ebc0c7e4 --- /dev/null +++ b/src/testing/tinydata/validate-tiny-json.xp3 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/validate/METASCHEMA-SCHXSLT-VALIDATE.xpl b/src/validate/METASCHEMA-SCHXSLT-VALIDATE.xpl index 53ce2154..474d2ea8 100644 --- a/src/validate/METASCHEMA-SCHXSLT-VALIDATE.xpl +++ b/src/validate/METASCHEMA-SCHXSLT-VALIDATE.xpl @@ -3,9 +3,7 @@ xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0" xmlns:metaschema="http://csrc.nist.gov/ns/metaschema/1.0" xmlns:schxslt="https://doi.org/10.5281/zenodo.1495494" - type="metaschema:METASCHEMA-ALL-SCHEMAS" name="METASCHEMA-ALL-SCHEMAS"> - - + type="metaschema:METASCHEMA-SCHXSLT-VALIDATE" name="METASCHEMA-SCHXSLT-VALIDATE"> @@ -28,6 +26,8 @@ + + diff --git a/src/validate/METASCHEMA-VALIDATE.xpl b/src/validate/METASCHEMA-VALIDATE.xpl deleted file mode 100644 index c0668bb2..00000000 --- a/src/validate/METASCHEMA-VALIDATE.xpl +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/validate/METASCHEMA-XSD-VALIDATE.xpl b/src/validate/METASCHEMA-XSD-VALIDATE.xpl new file mode 100644 index 00000000..cb3f6a47 --- /dev/null +++ b/src/validate/METASCHEMA-XSD-VALIDATE.xpl @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SUCCESS - XSD Validation has apparently run without error on document { $base } + + + + + + + + + \ No newline at end of file diff --git a/src/validate/Makefile b/src/validate/Makefile index 665c7ee4..683f1d8f 100644 --- a/src/validate/Makefile +++ b/src/validate/Makefile @@ -1,11 +1,22 @@ include ../testing/make_common.mk +# Note that Makefile definitions in other subdirectories use scripts defined in this one + + # XML Calabash prefers absolute paths test_metaschema:=../testing/models_metaschema.xml .PHONY: test -test: smoke-test ## Run all tests +test: pre-checks smoke-test ## Run all tests + +# As a pre-check we validate the test metaschema first; +# if this succeeds we check its composition + +.PHONY: pre-checks ## Validate test inputs (model metaschema) + ./mvn-metaschema-xsd-validate-xpl.sh "$(test_metaschema)" + ./mvn-composition-validate-xpl.sh "$(test_metaschema)" + .PHONY: smoke-test smoke-test: ## Run all smoke-tests - ./mvn-composition-validate-xpl.sh "$(test_metaschema)" + diff --git a/src/validate/mvn-metaschema-xsd-validate-xpl.sh b/src/validate/mvn-metaschema-xsd-validate-xpl.sh new file mode 100644 index 00000000..cf163d52 --- /dev/null +++ b/src/validate/mvn-metaschema-xsd-validate-xpl.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash +source "$SCRIPT_DIR/../common/subcommand_common.bash" + +usage() { + cat < - You are good - well-formed, no reported errors + You are good - well-formed, with no reported Schematron messages (reports or failed assertions)
    diff --git a/support/download-jars.sh b/support/download-jars.sh new file mode 100644 index 00000000..1e072ad2 --- /dev/null +++ b/support/download-jars.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# This script attempts to download MorganaXProcIII + + +mkdir -p lib + +download() { + proj=$1 + lcproj=`echo $proj | tr '[:upper:'] '[:lower:]'` + uri="https://github.com/nineml/$lcproj/releases/latest" + ver=`curl -sI $uri | grep -i location: | sed "s#^.*/tag/##" | tr -d '\n\r'` + if [ ! -f "lib/$proj-$ver.jar" ]; then + echo "Downloading $proj ..." + rm -f lib/$proj-*.jar + uri="https://github.com/nineml/$lcproj/releases/download/$ver/$lcproj-$ver.zip" + curl -s -L -o lib/$lcproj-$ver.zip $uri + cd lib + unzip -q -j $lcproj-$ver.zip "*.jar" + rm $lcproj-$ver.zip + cd .. + fi +} + +download CoffeeGrinder +download CoffeeFilter +download CoffeeSacks + +if [ ! -d lib/xmlcalabash1-coffeepress.jar ]; then + echo "Downloading CoffeePress ..." + curl -s -L -o coffeepress.zip \ + https://github.com/ndw/xmlcalabash1-coffeepress/releases/download/1.0.0/xmlcalabash1-coffeepress-1.0.0.zip + unzip -q -j coffeepress.zip "*.jar" + mv *.jar lib/ + rm -f coffeepress.zip +fi + +if [ ! -d xmlcalabash-1.5.7-120 ]; then + echo "Downloading XML Calabash ..." + curl -s -L -o xmlcalabash.zip \ + https://github.com/ndw/xmlcalabash1/releases/download/1.5.7-120/xmlcalabash-1.5.7-120.zip + unzip -q xmlcalabash.zip + rm -f xmlcalabash.zip +fi + +if [ ! -f saxon-he-12.3.jar ]; then + echo "Downloading Saxon 12.3 ..." + curl -s -L -o SaxonHE12-3J.zip https://www.saxonica.com/download/SaxonHE12-3J.zip + unzip -q -o SaxonHE12-3J.zip "*.jar" + rm -f SaxonHE12-3J.zip saxon-he-test*.jar saxon-he-xqj*.jar +fi + +if [ ! -f saxon-he-12.3.jar ]; then + echo "Downloading Saxon 12.3 ..." + curl -s -L -o SaxonHE12-3J.zip https://www.saxonica.com/download/SaxonHE12-3J.zip + unzip -q -o SaxonHE12-3J.zip "*.jar" + rm -f SaxonHE12-3J.zip saxon-he-test*.jar saxon-he-xqj*.jar +fi + + + https://sourceforge.net/projects/morganaxproc-iiise/files/MorganaXProc-IIIse-1.3.6/MorganaXProc-IIIse-1.3.6.zip/download + + + + diff --git a/support/pattern-test.xsl b/support/pattern-test.xsl new file mode 100644 index 00000000..d79ff1cd --- /dev/null +++ b/support/pattern-test.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + C + g + I + + + + + + + + + + \ No newline at end of file diff --git a/support/refresh-lib.sh b/support/refresh-lib.sh new file mode 100644 index 00000000..4dc2b488 --- /dev/null +++ b/support/refresh-lib.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# This script attempts to download MorganaXProcIII + + +mkdir -p lib + +pushd lib + +morgana=MorganaXProc-IIIse-1.3.6 + +morgana_download="https://sourceforge.net/projects/morganaxproc-iiise/files/${morgana}/${morgana}.zip/download" + +if [ ! -f "${morgana}.zip" ]; then + echo "Downloading Morgana XProc III SE ..." + curl -L -o "${morgana}.zip" "${morgana_download}" + unzip -qo "${morgana}.zip" -x __MACOSX/** +fi + + +if [ ! -f MorganaXProc-IIIse-1.3.6/MorganaXProc-IIIse_lib/saxon-he-12.3.jar ]; then + echo "Downloading Saxon 12.3 ..." + curl -s -L -o SaxonHE12-3J.zip https://www.saxonica.com/download/SaxonHE12-3J.zip + unzip -q -o SaxonHE12-3J.zip "*.jar" + rm -f SaxonHE12-3J.zip saxon-he-test*.jar saxon-he-xqj*.jar lib/* + rmdir lib + mv -f saxon-he-12.3.jar MorganaXProc-IIIse-1.3.6/MorganaXProc-IIIse_lib + +fi + +# C:\Users\wap1\Documents\usnistgov\metaschema-xslt\support\lib\MorganaXProc-IIIse-1.3.6\MorganaXProc-IIIse_lib + +popd + diff --git a/support/schxslt b/support/schxslt index 87cf981d..3f961be6 160000 --- a/support/schxslt +++ b/support/schxslt @@ -1 +1 @@ -Subproject commit 87cf981dcefd80247d2203fbdf63f5f15f212e1d +Subproject commit 3f961be6b1e7b1bd6522b39002d1c082bc841071 diff --git a/support/xslt3-functions b/support/xslt3-functions new file mode 160000 index 00000000..c528c506 --- /dev/null +++ b/support/xslt3-functions @@ -0,0 +1 @@ +Subproject commit c528c506a4ee3f87cd508795b3965def9bd49815 diff --git a/support/xspec b/support/xspec deleted file mode 160000 index 9cef3713..00000000 --- a/support/xspec +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9cef3713f5a7aaedf38a4ec2190ba3262d51cd72 diff --git a/support/xspec-dev/XSPEC-BATCH.xsl b/support/xspec-dev/XSPEC-BATCH.xsl deleted file mode 100644 index 98ed7016..00000000 --- a/support/xspec-dev/XSPEC-BATCH.xsl +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - - - - - - ../xspec/src/reporter/junit-report.xsl - - - - - - - - - - - src - - *.xspec - - no - - - - - - - - - - no - - - no - - - - - - select={$pattern} - recurse={ if ($recurse=('no','false')) then 'no' else 'yes' } - on-error={ if ($stopping-on-error) then 'fail' else 'warning' } - - - - - - - - - - ERROR: Unable to resolve collection at URI {$collection-uri} - getting {$err:code} '{$err:description}' - - - - - - Param $baseURI is: { $baseURI } - Static base URI is: { static-base-uri() } - Collection location is: { $collection-location } - - - - - - Acquiring collection from { $collection-uri } - - - - - - - - ERROR: Unable to compile XSpec at { $my?name } - getting {$err:code} '{$err:description}' - - - - - - - - - - ERROR: - Unable to execute compiled XSpec from { /*/xsl:variable[@name='Q{{http://www.jenitennison.com/xslt/xspec}}xspec-uri'] } - getting {$err:code} - '{$err:description}' - - - - - - - - - - - - - - - - - - - - - - - WARNING: of { count($collection-in) } { if (count($collection-in)=1) then 'file' else 'files' }, { count($dropped) } { if (count($dropped) = 1) then 'file selected was' else 'were' } dropped - either unavailable, would not compile (XSpec to XSLT), or would not execute (XSLT): - { $dropped?name => string-join(', ') } - - - - - - - Failures detected - process terminating - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WARNING: No JUnit report is written to '{ $junit-to }' - try a file name with suffix - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {$report-to}/{$xspec-basename}.html - - - - - - - - - - - - - - Writing report {$filename} ... - - - - - - - - - Writing report {$filename} ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/XSPEC-SINGLE.xsl b/support/xspec-dev/XSPEC-SINGLE.xsl deleted file mode 100644 index 5599a8ee..00000000 --- a/support/xspec-dev/XSPEC-SINGLE.xsl +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - ../xspec/src/compiler/compile-xslt-tests.xsl - - - - - - - - - - - - - - - ... and formatted a report. - - - - - - - - - - - - - - - - - - - - - - - - - - ... compiled XSpec ... - - - - - - - - - - - - - - - - - - - - ... executed XSpec ... - - - \ No newline at end of file diff --git a/support/xspec-dev/mvn-saxon-xspec-batch-quiet.sh b/support/xspec-dev/mvn-saxon-xspec-batch-quiet.sh deleted file mode 100644 index 9c64eb4e..00000000 --- a/support/xspec-dev/mvn-saxon-xspec-batch-quiet.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=../common/subcommand_common.bash - -source "$SCRIPT_DIR/../../src/common/subcommand_common.bash" - -XSLT_FILE="${SCRIPT_DIR}/XSPEC-BATCH.xsl" -LOGFILE=${LOGFILE:-"xspec_$(date +"%Y%m%d%H%M").log.txt"} - -usage() { - cat </dev/null to drop all runtime messages / progress reports instead of logging -# the process should error out only if stop-on-error=yes, otherwise it will do its best to complete -# invoke_saxon "${SAXON_ARGS}" 2>${LOGFILE} | echo_on_error "Failure running XSpec: see ${LOGFILE}" | tee ${LOGFILE} -invoke_saxon "${SAXON_ARGS}" 2>${LOGFILE} | tee ${LOGFILE} diff --git a/support/xspec-dev/mvn-saxon-xspec-batch.sh b/support/xspec-dev/mvn-saxon-xspec-batch.sh deleted file mode 100755 index 16c34ae0..00000000 --- a/support/xspec-dev/mvn-saxon-xspec-batch.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=../common/subcommand_common.bash - -source "$SCRIPT_DIR/../../src/common/subcommand_common.bash" - -XSLT_FILE="${SCRIPT_DIR}/XSPEC-BATCH.xsl" -LOGFILE=${LOGFILE:-"xspec_$(date +"%Y%m%d%H%M").log.txt"} - -usage() { - cat </dev/null to drop all runtime messages / progress reports instead of logging -# the process should error out only if stop-on-error=yes, otherwise it will do its best to complete -invoke_saxon "${SAXON_ARGS}" 2>&1 | tee ${LOGFILE} diff --git a/support/xspec-dev/mvn-saxon-xspec-html.sh b/support/xspec-dev/mvn-saxon-xspec-html.sh deleted file mode 100755 index 8aae060a..00000000 --- a/support/xspec-dev/mvn-saxon-xspec-html.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=../common/subcommand_common.bash - -source "$SCRIPT_DIR/../../src/common/subcommand_common.bash" - -XSLT_FILE="${SCRIPT_DIR}/XSPEC-SINGLE.xsl" - -usage() { - cat </dev/null` in the command invoking the script. - -``` -./mvn-saxon-xspec-batch.sh folder=src/project recurse=yes 2>/dev/null -``` - -All XSpec files in the folder `src/project` and any subfolders, reporting results to the console (STDOUT) but not creating HTML reports and not echoing warning or error messages to the console. - -It is best to silence STDERR only after you are confident that all XSpecs in your file set can be run successfully, especially if the "break early on error" option is set (since you will neither see STDERR nor get any results). - -## Enhanced HTML Production - -In order to work around limitations in the current XSpec HTML production (details with respect to its deployment under XProc 1.0), a [new HTML production XSLT](xspec-mx-html-report.xsl) is provided here, for use either for standalone XSpec reporting, or for reporting results from several XSpecs in aggregate ("batch"). - -[This XSLT ](xspec-mx-html-report.xsl) produces standalone HTML including embedded CSS and some lightweight Javascript supporting navigation features. - -### Theming HTML from XProc - -The XProc files support a runtime option, `theme`, which also exposes control of the theme setting (in the HTML and CSS). This takes the form of an HTML `class` value on the `body` element, along with CSS to be applied to the page on the basis of that setting. - -- `theme=clean` (the default) produces a medium-contrast color-neutral format -- `theme=uswds` uses colors for emphasis from the USWDS color scheme -- `theme=classic` uses colors drawn from the good-old XSpec HTML -- `theme=toybox` provides a more extravagant scheme. - -New themes can be added in the XSLT or in a new "shell" XSLT importing it, by copying and modifying an appropriate template to match the new theme and give it style. Such an importing XSLT can also modify any other feature of the HTML page result. - diff --git a/support/xspec-dev/testing.md b/support/xspec-dev/testing.md deleted file mode 100644 index 6bec6661..00000000 --- a/support/xspec-dev/testing.md +++ /dev/null @@ -1,28 +0,0 @@ -# Testing - -This work in support of XSpec is in need of more rigorous testing. - -Interactive testing has been performed with all scripts. - -But requirements and specifications are loose, having been driven up to this point by functional requirements faced by the metaschema-xslt project - for a flexible, performant runtime that works independently of licensed software, with developer-friendly controls from the command line and inside CI/CD. Specifically, this means a number of issues, including testing, that bear on full integration back into XSpec have been set aside for the present. - -Some experience in application will also be helpful in prioritizing the testing work to be done. - -Meanwhile, some interesting questions, both practical and theoretical, are posed by the need to test these capabilities, especially outside particular deployments. - -For which capabilities can we write XSpec or meaningfully test and confirm (expose and document) in other ways, including - - - `xsl:message` behavior including terminate="yes" - - side effects such as `xsl:result-document`? - - Runtime parameter semantics - - Exception handling - -(XSpec especially with `@run-as='external'` is able to provide support for much of this, but specific means are tbd.) - -Contributor at-galtm also notes that message handling code in the [xslt3-functions project repository](https://github.com/usnistgov/xslt3-functions) is configurable to emit processing instructions (instead of or with `xsl:message`) as message proxies, making this functionality testable. - -Additionally, plenty of 'obvious' tasks remain to be done, including - - - Addressing functional gaps e.g. Schematron, `x:label`, `x:pending` - - Scope/coverage analysis - - XSpec for "easy" stuff, including HTML rendering diff --git a/support/xspec-dev/testing/copy_me.xsl b/support/xspec-dev/testing/copy_me.xsl deleted file mode 100644 index 6e34968e..00000000 --- a/support/xspec-dev/testing/copy_me.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/support/xspec-dev/testing/iso8601.ixml b/support/xspec-dev/testing/iso8601.ixml deleted file mode 100644 index 9a4b6933..00000000 --- a/support/xspec-dev/testing/iso8601.ixml +++ /dev/null @@ -1,171 +0,0 @@ -{ An Invisible XML grammar for ISO 8601(:2004?) dates and times. } -{ Originally constructed by Norm Tovey-Walsh, 17 April 2022 } -{ See https://en.wikipedia.org/wiki/ISO_8601 among others } - --iso8601-datetime = date - ; time - ; datetime - ; duration - ; interval - ; recurrence . - -date = calendar-date ; ordinal-date ; week-date . - --time = local-time ; utc-time . - --datetime = local-datetime ; utc-datetime . - -local-datetime = -date, -'T', -local-time-no-t . -utc-datetime = -date, -'T', -utc-time-no-t . - -duration = -standard-duration; -alternate-duration . - -interval = start-end-interval - ; start-plus-duration-interval - ; duration-plus-end-interval . - -recurrence = repeat-count, -'/', interval . - -{ -- Calendar dates -- } - --calendar-date = complete-calendar-date - ; reduced-accuracy-calendar-date - ; expanded-calendar-date . - --complete-calendar-date = year, month, day; year, -'-', month, -'-', day . - --reduced-accuracy-calendar-date = year, -'-', month; year; century . - --expanded-calendar-date = expanded-year, month, day - ; expanded-year, -'-', month, -'-', day - ; expanded-year, -'-', month - ; expanded-year - ; expanded-century . - -{ -- Ordinal dates -- } - --ordinal-date = complete-ordinal-date ; expanded-ordinal-date . - --complete-ordinal-date = year, day-of-year - ; year, -'-', day-of-year . - --expanded-ordinal-date = expanded-year, day-of-year - ; expanded-year, -'-', day-of-year . - -{ -- Week dates -- } - --week-date = complete-week-date - ; reduced-accuracy-week-date - ; expanded-week-date . - --complete-week-date = year, -'W', week, day-of-week - ; year, -'-W', week, -'-', day-of-week . - --reduced-accuracy-week-date = year, -'W', week - ; year, -'-W', week . - --expanded-week-date = expanded-year, -'W', week, day-of-week - ; expanded-year, -'-W', week, '-', day-of-week - ; expanded-year, -'W', week - ; expanded-year, -'-W', week . - -{ -- Local time -- } - -local-time = local-time-t ; local-time-no-t . - --local-time-t = local-time-without-utc-t; local-time-with-utc-t . --local-time-no-t = local-time-without-utc; local-time-with-utc . - --local-time-without-utc-t = -'T', local-time-without-utc . - --local-time-without-utc = hour, minute, second - ; hour, -':', minute, -':', second - ; hour, minute - ; hour, -':', minute - ; hour - ; fractional-second-local-time - ; fractional-minute-local-time - ; fractional-hour-local-time . - --local-time-with-utc-t = -local-time-without-utc-t, utc-offset . --local-time-with-utc = -local-time-without-utc, utc-offset . - --fractional-second-local-time = (hour, minute, second; hour, -':', minute, -':', second), - fraction-sep, - fractional-second . - --fractional-minute-local-time = (hour, minute; hour, -':', minute), - fraction-sep, - fractional-minute . - --fractional-hour-local-time = hour, fraction-sep, fractional-hour . - -utc-offset = offset-hour, (-':'?, offset-minute)? . - -{ -- UTC time -- } - -utc-time = utc-time-t ; utc-time-no-t . --utc-time-t = -local-time-without-utc-t, -'Z' . --utc-time-no-t = -local-time-without-utc, -'Z' . - -{ -- Durations -- } - --standard-duration = -'P', (standard-ymdhs-duration ; standard-week-duration) . - -{ N.B. This tecnically allows a standard-ymdhs-duration with no fields. } --standard-ymdhs-duration = duration-years?, duration-months?, duration-days?, - (-'T', duration-hours?, duration-minutes?, duration-seconds?)? . --standard-week-duration = duration-weeks . - --alternate-duration = -'P', (alternate-ymd-duration ; alternate-yd-duration) . - --alternate-ymd-duration = year, month, day, -'T', hour, minute, second - ; year, -'-', month, -'-', day, -'T', hour, -':', minute, -':', second . --alternate-yd-duration = year, number-of-days, -'T', hour, minute, second - ; year, -'-', number-of-days, -'T', hour, -':', minute, -':', second . - --start-end-interval = (date; datetime), -'/', (date; datetime) . --start-plus-duration-interval = (date; datetime), -'/', duration . --duration-plus-end-interval = duration, -'/', (date; datetime) . - -duration-years = digit+, -'Y' . -duration-months = digit+, -'M' . -duration-days = digit+, -'D' . -duration-hours = digit+, -'H' . -duration-minutes = digit+, -'M' . -duration-seconds = digit+, -'S' . -duration-weeks = digit+, -'W' . - -{ -- Recurrence -- } - --repeat-count = -'R-1' ; -'R' ; -'R', repetitions . -repetitions = digit+ . - -{ -- Utility rules -- } - -expanded-year = sign, digit+, digit, digit, digit . -expanded-century = sign, digit+, digit, digit . --sign = -'+' ; '-' . - -offset-hour = @direction, digit, digit . -offset-minute = digit, digit . -direction = '+'; '-' . - -year = digit, digit, digit, digit . -century = digit, digit . -month = digit, digit . -week = digit, digit . -day = digit, digit . -hour = digit, digit . -minute = digit, digit . -second = digit, digit . -fractional-second = digit+ . -fractional-minute = digit+ . -fractional-hour = digit+ . - -day-of-year = digit, digit, digit . -number-of-days = -day-of-year . -day-of-week = digit . - --digit = ["0"-"9"] . --fraction-sep = -[','; '.'] . diff --git a/support/xspec-dev/testing/ixml-demo.xsl b/support/xspec-dev/testing/ixml-demo.xsl deleted file mode 100644 index da0232d5..00000000 --- a/support/xspec-dev/testing/ixml-demo.xsl +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - iso8601.ixml - - - - - 1962-06-28 - 1963-11-04 - 2024-02-30 - 2024-02-99 - 2024-01-17T17:26:38.416457100-05:00 - 2024-02-300 - 2025-12-25 - 2025-12-31T - - - - - - - - - - - - - - - - - - - - BUST on '{ $maybeDateTime }' - - - - - - diff --git a/support/xspec-dev/testing/ixml-parsing.xspec b/support/xspec-dev/testing/ixml-parsing.xspec deleted file mode 100644 index 6fdc1345..00000000 --- a/support/xspec-dev/testing/ixml-parsing.xspec +++ /dev/null @@ -1,92 +0,0 @@ - - - - - Parsing some dates - - - - 2024-01-20 - - - - - 2024 - 01 - 20 - - - - - - - 2024-01-0 - - - - BUST on '2024-01-0' - - - - - - 2024-01-18T14:44 - - - - - 2024 - 01 - 18 - 14 - 44 - - - - - - - 2024-01-18T14:44:10 - - - - - 2024 - 01 - 18 - 14 - 44 - 10 - - - - - - - 2024-01-18T14:44:10.777578600-05:00 - - - - - 2024 - 01 - 18 - 14 - 44 - 10 - 777578600 - - 05 - 00 - - - - - - - diff --git a/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh b/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh deleted file mode 100644 index 2fceeba5..00000000 --- a/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=../common/subcommand_common.bash - -source "$SCRIPT_DIR/../../../src/common/subcommand_common.bash" - -XPROC_FILE="${SCRIPT_DIR}/xspec-test-batch.xpl" -REPORT_HTML="xspec-test-report.html" - -usage() { - cat < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/testing/xspec-basic.xspec b/support/xspec-dev/testing/xspec-basic.xspec deleted file mode 100644 index bdccf48c..00000000 --- a/support/xspec-dev/testing/xspec-basic.xspec +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/testing/xspec-shell.xspec b/support/xspec-dev/testing/xspec-shell.xspec deleted file mode 100644 index ba66430f..00000000 --- a/support/xspec-dev/testing/xspec-shell.xspec +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/testing/xspec-test-batch.xpl b/support/xspec-dev/testing/xspec-test-batch.xpl deleted file mode 100644 index 2b25a22f..00000000 --- a/support/xspec-dev/testing/xspec-test-batch.xpl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/xspec-assurance.sch b/support/xspec-dev/xspec-assurance.sch deleted file mode 100644 index 42c624c2..00000000 --- a/support/xspec-dev/xspec-assurance.sch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - No document found at - - - - \ No newline at end of file diff --git a/support/xspec-dev/xspec-batch-report.xpl b/support/xspec-dev/xspec-batch-report.xpl deleted file mode 100644 index abd9ea5d..00000000 --- a/support/xspec-dev/xspec-batch-report.xpl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/xspec-mx-html-report.xsl b/support/xspec-dev/xspec-mx-html-report.xsl deleted file mode 100644 index a817368b..00000000 --- a/support/xspec-dev/xspec-mx-html-report.xsl +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - - - - clean - - - - - - - - - - - - - - XSpec - { $result-count } { if ($result-count eq 1) then 'test' else 'tests'} in { $report-count } { if ($report-count eq 1) then 'report' else 'reports'} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • FAILING - - { ancestor-or-self::*/x:label => string-join(' - ') } -
  • -
    - - -
    -
    - -
    -

    XSpec Report - { @xspec/replace(.,'.*/','') }

    - -
    -
    - - - -
    - - XSpec Report - { @xspec/replace(.,'.*/','') } - -
    - -
    - -
    -
    - - - - - -
    - -
    -
    - -
    - - - - - - -
    - -
    -
    - - - - - - - - - - 🤞 - - - 👍 - - - 👎 - - - - -

    { local-name(..) }/{ local-name(.) }: { . }

    -
    - - - - -

    { local-name(..) }/{ local-name(.) }: { . }

    -
    - - -

    { local-name(..) }/{ local-name(.) }: { format-dateTime(xs:dateTime(.),'[MNn] [D1], [Y0001] [H01]:[m01]:[s01]') } ({.})

    -
    - - - - - -
    - - - open - - - - -
    - -
    -
    -
    - - - - - { $whose/ancestor::x:report ! ('report' || count(.|preceding-sibling::x:report || '-' )) }{ $whose/@id } - - - - - - - - - - { self::x:report/'Total tests '}{ child::x:label } -   - - - - - - - - - - - - { . } - : - - - - - - - - - { child::x:label } -   - - - { (child::x:test/@pending/('Pending ' || .),child::x:test[@successful='true']/'Passes','Fails')[1] } - - - - - Expecting { child::x:label } - - - -
    - - - -
    -
    - - -
    - - - - - -
    -
    - - -

    Expecting (testing against)

    -
    - - -

    Producing (actual result)

    -
    - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - - - - -

    From input

    -
    - - - -

    Expecting

    -
    - - - - - - -
    - - - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - -.uswds { - background-color: #f0f0f0; - - .label { background-color: #1a4480; color: white} - .pending .label { background-color: inherit; color: black } - .passing { background-color: #d9e8f6 } - .pending { background-color: white } - .failing { background-color: #f8dfe2 } - .failing .passing { background-color: #d9e8f6 } - .pending.zero, .failing.zero { background-color: inherit } -} - - - - - - - -.classic { - h1, .h1, .label { background-color: #606; color: #6f6 } - h1 { padding: 0.2em } - .pending .label { background-color: inherit; color: black } - .passing { background-color: #cfc } - .pending { background-color: #eee } - .failing { background-color: #fcc } - .failing .passing { background-color: #cfc } - .pending.zero, .failing.zero { background-color: inherit } -} - - - - - -.toybox { - .label { background-color: black; color: white } - .failing .label { background-color: darkred } - .passing .label { background-color: darkgreen } - .pending .label { background-color: inherit; color: black } - .passing { background-color: honeydew } - .pending { background-color: cornsilk } - .failing { background-color: mistyrose } - .failing .passing { background-color: honeydew } - .pending.zero, .failing.zero { background-color: inherit } -} - - - - - No template for theme '{ $theme }' - using 'simple' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/support/xspec-dev/xspec-single-report.xpl b/support/xspec-dev/xspec-single-report.xpl deleted file mode 100644 index a847de3b..00000000 --- a/support/xspec-dev/xspec-single-report.xpl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/xspec-single-xspec-repo-report.xpl b/support/xspec-dev/xspec-single-xspec-repo-report.xpl deleted file mode 100644 index 402b1557..00000000 --- a/support/xspec-dev/xspec-single-xspec-repo-report.xpl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/xspec-dev/xspec-summarize.xsl b/support/xspec-dev/xspec-summarize.xsl deleted file mode 100644 index 451f8d5e..00000000 --- a/support/xspec-dev/xspec-summarize.xsl +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - { @xspec } - { @stylesheet } - - - - - - { ancestor-or-self::*/child::label => string-join(' : ') } - - - - - \ No newline at end of file diff --git a/support/xspec-dev/xspec-summary-reduce.xsl b/support/xspec-dev/xspec-summary-reduce.xsl deleted file mode 100644 index fad32c0f..00000000 --- a/support/xspec-dev/xspec-summary-reduce.xsl +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - { (1 to 14) ! ' ...' } - XSpec summary report: { mx:enumerate('XSpec',count(report)) } - - { (1 to 14) ! ' ...' } - - - - - - - SUCCESS - { mx:give-report-counts(.) } - NO FAILURES REPORTED - - - - - - FAILURE - { mx:give-report-counts(.) } - { count(descendant::fail) } { mx:pluralize('failure',count(descendant::fail)) => upper-case() } REPORTED - - - - - { xspec-file ! tokenize(.,'/')[last()] } testing { xslt-file ! tokenize(.,'/')[last()] }: { mx:enumerate('test',@test-count) }, { @pending-count} pending, { mx:enumerate('failure',count(fail)) } - - - - - { mx:enumerate('report',count($r/report)) } with { mx:enumerate('test', sum($r/report/@test-count)) } ({ sum($r/report/@pending-count) } pending) - - - - - - - { $c } { mx:pluralize($nom,$c) } - - - - - - - - - - - - - { . }{ 's'[$plural] } - - - \ No newline at end of file

    { $checked } Validating { $validating-filename } - { mx:metaschema } - found { + 'IN'[not($reported-valid)] }VALID