Skip to content

Commit e3c60dd

Browse files
committed
[WIP] Relocate constraints, fix MetaPath for field not flag for 1st example for #545
1 parent 9c5cb89 commit e3c60dd

File tree

1 file changed

+7
-5
lines changed
  • website/content/tutorials/5-constraints-has-cardinality

1 file changed

+7
-5
lines changed

website/content/tutorials/5-constraints-has-cardinality/_index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We will begin where we left off in the previous tutorial, with the model and con
1818
<?xml-model href="https://raw.githubusercontent.com/usnistgov/metaschema/develop/schema/xml/metaschema.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
1919
<METASCHEMA xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
2020
<schema-name>Computer Model</schema-name>
21-
<schema-version>0.0.12</schema-version>
21+
<schema-version>0.0.11</schema-version>
2222
<short-name>computer</short-name>
2323
<namespace>http://example.com/ns/computer</namespace>
2424
<json-base-uri>http://example.com/ns/computer</json-base-uri>
@@ -326,13 +326,15 @@ We will begin where we left off in the previous tutorial, with the model and con
326326
<expect id="memory-same-byte-size" level="ERROR" target="." test="if (count(./memory/byte-size) > 0) then (sum(./memory/byte-size) mod ./memory/byte-size[1]) = 0 else (sum(./memory/size) mod ./memory/size[1]) = 0">
327327
<message>All memory modules SHOULD be the same size or byte-size for a computer.</message>
328328
</expect>
329-
<has-cardinality id="atx-memory-count-allowed" level="ERROR" target="motherboard[@type='atx']/memory" min-occurs="1" max-occurs="4"/>
330-
<has-cardinality id="atx-ata-sockets-count-allowed" level="ERROR" target="motherboard[@type='atx']/ata-socket" min-occurs="0" max-occurs="1"/>
331-
<has-cardinality id="mini-itx-memory-count-allowed" level="ERROR" target="motherboard[@type='mini-itx']/memory" min-occurs="1" max-occurs="2"/>
332-
<has-cardinality id="mini-itx-ata-sockets-count-allowed" level="ERROR" target="motherboard[@type='mini-itx']/ata-socket" min-occurs="0" max-occurs="0"/>
333329
</constraint>
334330
</define-assembly>
335331
</model>
332+
<constraint>
333+
<has-cardinality id="atx-memory-count-allowed" level="ERROR" target="motherboard[type='atx']/memory" min-occurs="1" max-occurs="4"/>
334+
<has-cardinality id="atx-ata-sockets-count-allowed" level="ERROR" target="motherboard[type='atx']/ata-socket" min-occurs="0" max-occurs="1"/>
335+
<has-cardinality id="mini-itx-memory-count-allowed" level="ERROR" target="motherboard[type='mini-itx']/memory" min-occurs="1" max-occurs="2"/>
336+
<has-cardinality id="mini-itx-ata-sockets-count-allowed" level="ERROR" target="motherboard[type='mini-itx']/ata-socket" min-occurs="0" max-occurs="0"/>
337+
</constraint>
336338
</define-assembly>
337339
</METASCHEMA>
338340
```

0 commit comments

Comments
 (0)