OSCAL icon indicating copy to clipboard operation
OSCAL copied to clipboard

XPath bug (typo ?) in oscal_catalog_metaschema.xml

Open iMichaela opened this issue 2 years ago • 1 comments

Describe the bug

Per the XPath tutorial, chapter Selecting nodes:

Expression Description
nodename Selects all nodes with the name "nodename"
/ Selects from the root node
// Selects nodes in the document from the current node that match the selection no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes

the following XPath are indicating a selection of the part, andprop respectively from the root and not from the current node (part ) when related to the assessment-methods of a control statement. I believe the intention was for the Path to represent a selection from the current node since an assessment-method is defined in the context of a control statement :

Line number Current Path Corrected Path
285 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name
299 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/prop[has-oscal-namespace('http://csrc.nist.gov/ns/rmf')]/@name part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//prop[has-oscal-namespace('http://csrc.nist.gov/ns/rmf')]/@name
305 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/prop[has-oscal-namespace(('http://csrc.nist.gov/ns/oscal','http://csrc.nist.gov/ns/rmf')) and @name='method']/@value part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//prop[has-oscal-namespace(('http://csrc.nist.gov/ns/oscal','http://csrc.nist.gov/ns/rmf')) and @name='method']/@value

Who is the bug affecting

OSCAL catalog developers and OSCAL content users

What is affected by this bug

Documentation, Metaschema, Tooling & API

How do we replicate this issue

Review oscal_catalog_metaschema.xml

Expected behavior (i.e. solution)

Line number Current Path Corrected Path
285 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name
299 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/prop[has-oscal-namespace('http://csrc.nist.gov/ns/rmf')]/@name part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//prop[has-oscal-namespace('http://csrc.nist.gov/ns/rmf')]/@name
305 part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]/prop[has-oscal-namespace(('http://csrc.nist.gov/ns/oscal','http://csrc.nist.gov/ns/rmf')) and @name='method']/@value part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment','assessment-method')]//prop[has-oscal-namespace(('http://csrc.nist.gov/ns/oscal','http://csrc.nist.gov/ns/rmf')) and @name='method']/@value

Other comments

No response

Revisions

No response

iMichaela avatar Oct 23 '23 00:10 iMichaela

At the 11/16 Triage Meeting: We will discuss this on Nov 30.

Arminta-Jenkins-NIST avatar Nov 16 '23 19:11 Arminta-Jenkins-NIST