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

Certain XPath expressions in profile resolver don't match spec #1075

Closed
galtm opened this issue Dec 19, 2021 · 1 comment
Closed

Certain XPath expressions in profile resolver don't match spec #1075

galtm opened this issue Dec 19, 2021 · 1 comment
Assignees
Labels
bug closable Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use.
Milestone

Comments

@galtm
Copy link
Contributor

galtm commented Dec 19, 2021

Describe the bug

I found some XPath expressions in src/utils/util/resolver-pipeline/oscal-profile-resolve-select.xsl that don't align with the latest spec. Can you confirm?

Line 181: <xsl:sequence select="some $m in ($importing/include/matching[o:calls-children(.)])
The element name include should say include-controls. Also, I believe the predicate expression belongs on include-controls (not matching) to align with where with-child-controls appears in the profile input document.

Line 191: <xsl:sequence select="some $m in ($importing/exclude-controls[o:calls-children(.)]/matcjomg)
matcjomg is a typo; it should say matching.

Lines 182 and 192: satisfies (matches($candidate/ancestor::control/@id,$m/@pattern/o:glob-as-regex(string(.))))
The matches function call errors out if the candidate has multiple ancestor controls that have an ID. Is that nesting depth meant to be supported? If so, maybe the some expression on the preceding line can range over both matching elements and ancestor controls.

Who is the bug affecting?

Users of profile resolver, under the conditions pertaining to these specific XPath expressions.

What is affected by this bug?

Selection of controls in the output of the profile resolver.

How do we replicate the issue?

For the first two items, inspect the XPath expressions and compare with the spec.
For the item on lines 182 and 192, use pattern matching to include or exclude a control that has multiple ancestor controls having IDs.

@galtm galtm added the bug label Dec 19, 2021
@wendellpiez wendellpiez added the Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use. label Dec 21, 2021
@wendellpiez wendellpiez self-assigned this Dec 21, 2021
@david-waltermire david-waltermire added this to the OSCAL 1.1.0 milestone Jan 21, 2022
@galtm
Copy link
Contributor Author

galtm commented Feb 4, 2022

I believe #1101 fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug closable Scope: Tooling and APIs Issues targeted at development of tooling and APIs to support OSCAL content creation and use.
Projects
None yet
Development

No branches or pull requests

3 participants