| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" |
| 3 |
xmlns:arf="http://scap.nist.gov/schema/asset-reporting-format/1.1" |
| 4 |
xmlns:ai="http://scap.nist.gov/schema/asset-identification/1.1" |
| 5 |
xmlns:core="http://scap.nist.gov/schema/reporting-core/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" |
| 6 |
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" |
| 7 |
targetNamespace="http://scap.nist.gov/schema/asset-reporting-format/1.1" elementFormDefault="qualified" |
| 8 |
attributeFormDefault="unqualified" version="1.1.1"> |
| 9 |
<xs:annotation> |
| 10 |
<xs:appinfo> |
| 11 |
<schema>Asset Reporting Format</schema> |
| 12 |
<author>David Waltermire, Adam Halbardier, John Wunder</author> |
| 13 |
<version>1.1.1</version> |
| 14 |
<date>2012-02-13</date> |
| 15 |
<sch:schema queryBinding="xslt2" xmlns:sch="http://purl.oclc.org/dsdl/schematron"> |
| 16 |
<sch:ns prefix="xml" uri="http://www.w3.org/XML/1998/namespace"/> |
| 17 |
<sch:ns prefix="xsd" uri="http://www.w3.org/2001/XMLSchema"/> |
| 18 |
<sch:ns prefix="arf" uri="http://scap.nist.gov/schema/asset-reporting-format/1.1"/> |
| 19 |
<sch:ns prefix="core" uri="http://scap.nist.gov/schema/reporting-core/1.1"/> |
| 20 |
<sch:ns prefix="ai" uri="http://scap.nist.gov/schema/asset-identification/1.1"/> |
| 21 |
<sch:ns prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/> |
| 22 |
<sch:ns prefix="xcf" uri="nist:scap:arf:xslt:function"/> |
| 23 |
<sch:pattern> |
| 24 |
|
| 25 |
|
| 26 |
<sch:let name="arf-namespace" value="string('http://scap.nist.gov/specifications/arf/vocabulary/relationships/1.0#')"/> |
| 27 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'isAbout' )]"> |
| 28 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 29 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 30 |
</sch:assert> |
| 31 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 32 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 33 |
</sch:assert> |
| 34 |
</sch:rule> |
| 35 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'retrievedFrom' )]"> |
| 36 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 37 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 38 |
</sch:assert> |
| 39 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 40 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 41 |
</sch:assert> |
| 42 |
</sch:rule> |
| 43 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'createdBy' )]"> |
| 44 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 45 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 46 |
</sch:assert> |
| 47 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 48 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 49 |
</sch:assert> |
| 50 |
</sch:rule> |
| 51 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'hasSource' )]"> |
| 52 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 53 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 54 |
</sch:assert> |
| 55 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 56 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 57 |
</sch:assert> |
| 58 |
</sch:rule> |
| 59 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'recordedBy' )]"> |
| 60 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 61 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 62 |
</sch:assert> |
| 63 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 64 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 65 |
</sch:assert> |
| 66 |
</sch:rule> |
| 67 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'initiatedBy' )]"> |
| 68 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 69 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 70 |
</sch:assert> |
| 71 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:assets/arf:asset[@id eq $m]"> |
| 72 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'asset')"/> |
| 73 |
</sch:assert> |
| 74 |
</sch:rule> |
| 75 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'createdFor' )]"> |
| 76 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 77 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 78 |
</sch:assert> |
| 79 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:report-requests/arf:report-request[@id eq $m]"> |
| 80 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'report-request')"/> |
| 81 |
</sch:assert> |
| 82 |
</sch:rule> |
| 83 |
<sch:rule context="core:relationship[fn:resolve-QName(@type, current()) eq fn:QName($arf-namespace,'hasMetadata' )]"> |
| 84 |
<sch:assert test="boolean(ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq current()/@subject])"> |
| 85 |
<sch:value-of select="xcf:controlled-vocab-error-domain(current(),'report')"/> |
| 86 |
</sch:assert> |
| 87 |
<sch:assert test="every $m in core:ref satisfies current()/ancestor::arf:asset-report-collection/arf:reports/arf:report[@id eq $m]"> |
| 88 |
<sch:value-of select="xcf:controlled-vocab-error-range(current(),'report')"/> |
| 89 |
</sch:assert> |
| 90 |
</sch:rule> |
| 91 |
</sch:pattern> |
| 92 |
<xsl:function name="xcf:controlled-vocab-error-domain" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xcf="nist:scap:arf:xslt:function" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform"> |
| 93 |
<xsl:param name="node"/> |
| 94 |
<xsl:param name="refName"/> |
| 95 |
<xsl:value-of select="concat(concat(concat(concat(string('All @subject attribute in a relationship of type '),namespace-uri-from-QName(resolve-QName($node/@type, $node))),local-name-from-QName(resolve-QName($node/@type, $node))),string(' must reference a ')),$refName)"/> |
| 96 |
</xsl:function> |
| 97 |
<xsl:function name="xcf:controlled-vocab-error-range" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xcf="nist:scap:arf:xslt:function" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform"> |
| 98 |
<xsl:param name="node"/> |
| 99 |
<xsl:param name="refName"/> |
| 100 |
<xsl:value-of select="concat(concat(concat(concat(string('All <ref> elements in a relationship of type '),namespace-uri-from-QName(resolve-QName($node/@type, $node))),local-name-from-QName(resolve-QName($node/@type, $node))),string(' must reference a ')),$refName)"/> |
| 101 |
</xsl:function> |
| 102 |
</sch:schema> |
| 103 |
</xs:appinfo> |
| 104 |
</xs:annotation> |
| 105 |
|
| 106 |
<xs:import namespace="http://scap.nist.gov/schema/asset-identification/1.1" schemaLocation="asset-identification_1.1.0.xsd"/> |
| 107 |
<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="../../common/xlink.xsd"/> |
| 108 |
<xs:import namespace="http://scap.nist.gov/schema/reporting-core/1.1" schemaLocation="reporting-core_1.1.0.xsd"/> |
| 109 |
<xs:element name="asset-report-collection"> |
| 110 |
<xs:annotation> |
| 111 |
<xs:documentation>The top-level report element.</xs:documentation> |
| 112 |
</xs:annotation> |
| 113 |
<xs:complexType> |
| 114 |
<xs:complexContent> |
| 115 |
<xs:extension base="core:relationships-container-type"> |
| 116 |
<xs:sequence> |
| 117 |
<xs:element name="report-requests" minOccurs="0"> |
| 118 |
<xs:annotation> |
| 119 |
<xs:documentation>Contains one or more requests for reports. Each report request must be referenced in a relationship on a report in the same asset-report-collection.</xs:documentation> |
| 120 |
</xs:annotation> |
| 121 |
<xs:complexType> |
| 122 |
<xs:sequence> |
| 123 |
<xs:element name="report-request" type="arf:ReportRequestType" maxOccurs="unbounded"> </xs:element> |
| 124 |
</xs:sequence> |
| 125 |
</xs:complexType> |
| 126 |
</xs:element> |
| 127 |
<xs:element minOccurs="0" name="assets"> |
| 128 |
<xs:annotation> |
| 129 |
<xs:documentation>Contains the representation of one or more assets represented using the Asset Identification format.</xs:documentation> |
| 130 |
</xs:annotation> |
| 131 |
<xs:complexType> |
| 132 |
<xs:sequence> |
| 133 |
<xs:element maxOccurs="unbounded" name="asset"> |
| 134 |
<xs:complexType> |
| 135 |
<xs:choice> |
| 136 |
<xs:element ref="ai:asset"/> |
| 137 |
<xs:element ref="arf:remote-resource"/> |
| 138 |
</xs:choice> |
| 139 |
<xs:attribute name="id" type="xs:NCName" use="required"> |
| 140 |
<xs:annotation> |
| 141 |
<xs:documentation>An internal ID to identify this asset.</xs:documentation> |
| 142 |
</xs:annotation> |
| 143 |
</xs:attribute> |
| 144 |
<xs:anyAttribute namespace="##other"> |
| 145 |
<xs:annotation> |
| 146 |
<xs:documentation>A placeholder so that content creators can add attributes as |
| 147 |
desired.</xs:documentation> |
| 148 |
</xs:annotation> |
| 149 |
</xs:anyAttribute> |
| 150 |
</xs:complexType> |
| 151 |
</xs:element> |
| 152 |
</xs:sequence> |
| 153 |
</xs:complexType> |
| 154 |
</xs:element> |
| 155 |
<xs:element name="reports"> |
| 156 |
<xs:annotation> |
| 157 |
<xs:documentation>Contains one or more reports.</xs:documentation> |
| 158 |
</xs:annotation> |
| 159 |
<xs:complexType> |
| 160 |
<xs:sequence> |
| 161 |
<xs:element name="report" type="arf:ReportType" maxOccurs="unbounded"> |
| 162 |
<xs:annotation> |
| 163 |
<xs:documentation>Contains a report, which is composed of zero or more relationships and a content payload.</xs:documentation> |
| 164 |
</xs:annotation> |
| 165 |
</xs:element> |
| 166 |
</xs:sequence> |
| 167 |
</xs:complexType> |
| 168 |
</xs:element> |
| 169 |
<xs:element minOccurs="0" name="extended-infos"> |
| 170 |
<xs:annotation> |
| 171 |
<xs:documentation>Contain other information elements. Used as an extension point.</xs:documentation> |
| 172 |
</xs:annotation> |
| 173 |
<xs:complexType> |
| 174 |
<xs:sequence> |
| 175 |
<xs:element maxOccurs="unbounded" name="extended-info"> |
| 176 |
<xs:annotation> |
| 177 |
<xs:documentation>Contains other information. Use as an extension point for data that does not fall into the categories defined in asset-report-collection.</xs:documentation> |
| 178 |
</xs:annotation> |
| 179 |
<xs:complexType> |
| 180 |
<xs:sequence> |
| 181 |
<xs:any namespace="##other" processContents="lax"/> |
| 182 |
</xs:sequence> |
| 183 |
<xs:attribute name="id" type="xs:NCName" use="required"> |
| 184 |
<xs:annotation> |
| 185 |
<xs:documentation>An internal ID to identify this object.</xs:documentation> |
| 186 |
</xs:annotation> |
| 187 |
</xs:attribute> |
| 188 |
<xs:anyAttribute namespace="##other"> |
| 189 |
<xs:annotation> |
| 190 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 191 |
</xs:annotation> |
| 192 |
</xs:anyAttribute> |
| 193 |
</xs:complexType> |
| 194 |
</xs:element> |
| 195 |
</xs:sequence> |
| 196 |
</xs:complexType> |
| 197 |
</xs:element> |
| 198 |
</xs:sequence> |
| 199 |
<xs:attribute name="id" type="xs:NCName"> |
| 200 |
<xs:annotation> |
| 201 |
<xs:documentation>The id for this collection.</xs:documentation> |
| 202 |
</xs:annotation> |
| 203 |
</xs:attribute> |
| 204 |
<xs:anyAttribute namespace="##other"> |
| 205 |
<xs:annotation> |
| 206 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 207 |
</xs:annotation> |
| 208 |
</xs:anyAttribute> |
| 209 |
</xs:extension> |
| 210 |
</xs:complexContent> |
| 211 |
</xs:complexType> |
| 212 |
<xs:key name="idKey"> |
| 213 |
<xs:selector xpath=".//arf:report-request|.//arf:asset|.//arf:report|.//arf:extended-info"/> |
| 214 |
<xs:field xpath="@id"/> |
| 215 |
</xs:key> |
| 216 |
<xs:keyref name="relSubjKeyRef" refer="arf:idKey"> |
| 217 |
<xs:selector xpath="core:relationships/core:relationship"/> |
| 218 |
<xs:field xpath="@subject"/> |
| 219 |
</xs:keyref> |
| 220 |
<xs:keyref name="relObjKeyRef" refer="arf:idKey"> |
| 221 |
<xs:selector xpath="core:relationships/core:relationship/core:ref"/> |
| 222 |
<xs:field xpath="."/> |
| 223 |
</xs:keyref> |
| 224 |
</xs:element> |
| 225 |
<xs:complexType name="ReportRequestType"> |
| 226 |
<xs:choice> |
| 227 |
<xs:element name="content"> |
| 228 |
<xs:annotation> |
| 229 |
<xs:documentation>Contains the content of the report request.</xs:documentation> |
| 230 |
</xs:annotation> |
| 231 |
<xs:complexType> |
| 232 |
<xs:sequence> |
| 233 |
<xs:any namespace="##other" processContents="lax"> |
| 234 |
<xs:annotation> |
| 235 |
<xs:documentation>Holds the content of a report request.</xs:documentation> |
| 236 |
</xs:annotation> |
| 237 |
</xs:any> |
| 238 |
</xs:sequence> |
| 239 |
<xs:anyAttribute namespace="##other"> |
| 240 |
<xs:annotation> |
| 241 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 242 |
</xs:annotation> |
| 243 |
</xs:anyAttribute> |
| 244 |
</xs:complexType> |
| 245 |
</xs:element> |
| 246 |
<xs:element ref="arf:remote-resource"/> |
| 247 |
</xs:choice> |
| 248 |
<xs:attribute name="id" type="xs:NCName" use="required"> |
| 249 |
<xs:annotation> |
| 250 |
<xs:documentation>An internal ID to identify this report request.</xs:documentation> |
| 251 |
</xs:annotation> |
| 252 |
</xs:attribute> |
| 253 |
<xs:anyAttribute namespace="##other"> |
| 254 |
<xs:annotation> |
| 255 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 256 |
</xs:annotation> |
| 257 |
</xs:anyAttribute> |
| 258 |
</xs:complexType> |
| 259 |
<xs:complexType name="ReportType"> |
| 260 |
<xs:choice> |
| 261 |
<xs:element name="content"> |
| 262 |
<xs:annotation> |
| 263 |
<xs:documentation>Contains the content of the report.</xs:documentation> |
| 264 |
</xs:annotation> |
| 265 |
<xs:complexType> |
| 266 |
<xs:sequence> |
| 267 |
<xs:any namespace="##other" processContents="lax"/> |
| 268 |
</xs:sequence> |
| 269 |
<xs:attribute name="data-valid-start-date" type="xs:date"/> |
| 270 |
<xs:attribute name="data-valid-end-date" type="xs:date"/> |
| 271 |
<xs:anyAttribute namespace="##other"> |
| 272 |
<xs:annotation> |
| 273 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 274 |
</xs:annotation> |
| 275 |
</xs:anyAttribute> |
| 276 |
</xs:complexType> |
| 277 |
</xs:element> |
| 278 |
<xs:element ref="arf:remote-resource"/> |
| 279 |
</xs:choice> |
| 280 |
<xs:attribute name="id" type="xs:NCName" use="required"> |
| 281 |
<xs:annotation> |
| 282 |
<xs:documentation>An internal ID to identify this report.</xs:documentation> |
| 283 |
</xs:annotation> |
| 284 |
</xs:attribute> |
| 285 |
<xs:anyAttribute namespace="##other"> |
| 286 |
<xs:annotation> |
| 287 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 288 |
</xs:annotation> |
| 289 |
</xs:anyAttribute> |
| 290 |
</xs:complexType> |
| 291 |
<xs:element name="object-ref"> |
| 292 |
<xs:annotation> |
| 293 |
<xs:documentation>Report creators can embedding this element in a report with the @ref_id referencing the ID of an asset, report, or report request. This element effectively acts as a pointer, allowing content produces to reference higher level ARF constructs in a report, without duplicating the data in that ARF construct.</xs:documentation> |
| 294 |
</xs:annotation> |
| 295 |
<xs:complexType> |
| 296 |
<xs:attribute name="ref-id" type="xs:NCName"/> |
| 297 |
</xs:complexType> |
| 298 |
</xs:element> |
| 299 |
<xs:element name="remote-resource"> |
| 300 |
<xs:annotation> |
| 301 |
<xs:documentation>Links to content stored external to this report.</xs:documentation> |
| 302 |
</xs:annotation> |
| 303 |
<xs:complexType> |
| 304 |
<xs:attribute ref="xlink:type" use="required" fixed="simple"> |
| 305 |
<xs:annotation> |
| 306 |
<xs:documentation>Fixed as a simple XLink.</xs:documentation> |
| 307 |
</xs:annotation> |
| 308 |
</xs:attribute> |
| 309 |
<xs:attribute ref="xlink:href" use="required"> |
| 310 |
<xs:annotation> |
| 311 |
<xs:documentation>A URI to the remote content. Producers and consumers should both know how to resolve the URI in order to be interoperable.</xs:documentation> |
| 312 |
</xs:annotation> |
| 313 |
</xs:attribute> |
| 314 |
<xs:anyAttribute namespace="##other"> |
| 315 |
<xs:annotation> |
| 316 |
<xs:documentation>A placeholder so that content creators can add attributes as desired.</xs:documentation> |
| 317 |
</xs:annotation> |
| 318 |
</xs:anyAttribute> |
| 319 |
</xs:complexType> |
| 320 |
</xs:element> |
| 321 |
</xs:schema> |
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|