Skip to content

Commit

Permalink
Slight enhancement to schema mitigating whitespace issue in validation
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez committed Sep 1, 2017
1 parent 7d4d13b commit 062aedd
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 52 deletions.
82 changes: 43 additions & 39 deletions OSCAL-dev.xpr

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions working/ISO-27002/ISO-27002-OSCAL-refined.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,15 @@
<declare-prop context="clause" class="number">
<required/>
<identifier/>
<value>
<inherit/>
<autonum>.1</autonum>
</value>
<value xml:space="preserve"><inherit/><autonum>.1</autonum></value>
</declare-prop>
<declare-part context="clause" class="objective">
<required/>
</declare-part>
<declare-prop context="iso-27002" class="number">
<required/>
<identifier/>
<value>
<inherit/>
<autonum>.1</autonum>
</value>
<value xml:space="preserve"><inherit/><autonum>.1</autonum></value>
</declare-prop>
<declare-part context="control" class="description">
<required/>
Expand Down
7 changes: 3 additions & 4 deletions working/SP800-53/SP800-53-declarations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
<declare-prop context="SP800-53-enhancement" class="name">
<singleton/>
<required/>
<value><inherit/>
<autonum>(1)</autonum></value>
<value xml:space="preserve"><inherit/> <autonum>(1)</autonum></value>
</declare-prop>
<declare-prop context="SP800-53-enhancement" class="baseline-impact">
<value>LOW</value>
Expand Down Expand Up @@ -73,8 +72,8 @@
<declare-prop context="item" class="name">
<singleton/>
<required/>
<value><inherit/><autonum>a.</autonum></value><!-- in controls -->
<value><inherit/><autonum>(a)</autonum></value><!-- in subcontrols -->
<value xml:space="preserve"><inherit/><autonum>a.</autonum></value><!-- in controls -->
<value xml:space="preserve"><inherit/><autonum>(a)</autonum></value><!-- in subcontrols -->

<!-- then even lower down -->
<value><inherit/><autonum>1.</autonum></value><!-- in subitems in controls -->
Expand Down
3 changes: 3 additions & 0 deletions working/lib/XSD/oscal-documented.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
xmlns:oscal="http://scap.nist.gov/schema/oscal"
elementFormDefault="qualified"
targetNamespace="http://scap.nist.gov/schema/oscal">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>
<xs:complexType name="collection-contents">
<xs:sequence>
<xs:element ref="oscal:title"/>
Expand Down Expand Up @@ -150,6 +152,7 @@
<xs:element ref="oscal:inherit"/>
<xs:element ref="oscal:autonum"/>
</xs:choice>
<xs:attribute ref="xml:space"/>
</xs:complexType>
</xs:element>
</xs:sequence>
Expand Down
2 changes: 2 additions & 0 deletions working/lib/XSD/oscal-interim.xsd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://scap.nist.gov/schema/oscal" xmlns:oscal="http://scap.nist.gov/schema/oscal">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<!-- We can have a catalog, or we can have only declarations for catalogs -->
<!-- Also we have an alias for 'catalog', namely 'collection', used for ad-hoc collections of controls -->
<!--
Expand Down Expand Up @@ -128,6 +129,7 @@
<xs:element ref="oscal:inherit"/>
<xs:element ref="oscal:autonum"/>
</xs:choice>
<xs:attribute ref="xml:space"/>
</xs:complexType>
</xs:element>
</xs:sequence>
Expand Down
11 changes: 11 additions & 0 deletions working/lib/XSD/xml.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:oscal="http://scap.nist.gov/schema/oscal">
<xs:import namespace="http://scap.nist.gov/schema/oscal" schemaLocation="oscal-interim.xsd"/>
<xs:attribute name="space">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:schema>
2 changes: 1 addition & 1 deletion working/lib/oscal-working.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ required = element required { empty }
# element limit { requiredClass, text } w/ @type= upper-bound-inclusive, lower-bound-exclusive, (w/ inclusive/exclusive etc.)

regex = element regex { text }
value = element value { ( \inherit | autonum | text )* }
value = element value { attribute xml:space { 'preserve' }?, ( \inherit | autonum | text )* }
\inherit = element inherit { attribute from { text }?, text }
autonum = element autonum { text }

Expand Down

0 comments on commit 062aedd

Please sign in to comment.