Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaschema composition fail: exception handling induces runtime error #18

Open
wendellpiez opened this issue Dec 9, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@wendellpiez
Copy link
Collaborator

Describe the bug

Reported on a metaschema in progress:

Generated compiled Schematron '/oscal/build/metaschema/toolchains/xslt-M4/validate/metaschema-composition-check.sch' as '/oscal/build/metaschema/toolchains/xslt-M4/validate/metaschema-composition-check-compiled.xsl'.
Schematron validation failed for metaschema 'src/metaschema/oscal_complete_metaschema.xml'.
Error evaluating ((xsl:copy-of, ...)) on line 59 column 35 of metaschema-build-refs.xsl:
  XTDE0410: An attribute node (in-xml) cannot be created after a child of the containing
  element. Most recent element start tag was output at line 111 of module metaschema-build-refs.xsl
An attribute node (in-xml) cannot be created after a child of the containing element. Most recent element start tag was output at line 111 of module metaschema-build-refs.xsl

This should not happen: the process should conclude even if outputs are marked with EXCEPTIONs.

A metaschema that produces the error is here (a WIP branch): https://github.com/Rene2mt/OSCAL/tree/860-identifier-scoping-documentation/src/metaschema

Who is the bug affecting?

Anyone developing a metaschema who inadvertantly writes one of the offending constructs, will be denied a composed metaschema, but not given any decent information for remediation.

What is affected by this bug?

Can't compose the metaschema! Can't check it for correctness or use it.

When does this occur?

TBD. Line 111 indicates the fail in this case is due to a dangling (orphan) field reference, so that is something to try.

How do we replicate the issue?

A metaschema that produces the error is here (a WIP branch): https://github.com/Rene2mt/OSCAL/tree/860-identifier-scoping-documentation/src/metaschema

But replication in a small standalone instance might be helpful for isolating it.

Expected behavior (i.e. solution)

No runtime error. Instead, a successful conclusion with EXCEPTIONs noted.

Other Comments

Because of the first-attributes-then-contents rule, the apply templates here needs to be broken between those producing attributes and those producing elements (possibly in two modes).

@wendellpiez wendellpiez added the bug Something isn't working label Dec 9, 2021
@wendellpiez wendellpiez self-assigned this Dec 9, 2021
@david-waltermire
Copy link
Collaborator

Need to confirm that this is still occurring, and if so unit test it and fix it. The implementation should give a meaningful runtime message instead of the traceback.

@wendellpiez
Copy link
Collaborator Author

Should this be spiked to confirm current status, or is it closable?

@david-waltermire david-waltermire transferred this issue from usnistgov/metaschema Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants