added in new IMS CC validation xsds
[acontent.git] / docs / home / ims / domainProfile_1 / lomLoose_constraintsDocument.scmt
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <schema xmlns="http://www.ascc.net/xml/schematron">\r
3   <ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema" />\r
4   <ns prefix="xsd" uri="http://www.w3.org/2001/XMLSchema" />\r
5   <ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance" />\r
6   <ns prefix="ac" uri="http://iwm.uni-koblenz.de/xsd/tel_addc_v1p1" />\r
7   <ns prefix="ims" uri="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" />\r
8   <!--***********************************************************************************************-->\r
9   <!--** Constraints document - this document holds Schematron rules that have been generated from **-->\r
10   <!--** AP condition and assertion elements. IMPORTANT: If this document exists, it MUST be       **-->\r
11   <!--** used in the validation of instances derived from the resultant schema - failure to do so  **-->\r
12   <!--** can result in an instance that does not conform to either the base schema or the          **-->\r
13   <!--** Application Profile.                                                                      **-->\r
14   <!--***********************************************************************************************-->\r
15   <pattern name="pattern_1">\r
16     <rule context="ims:organizations/ims:organization/ims:item/@identifierref | ims:manifest/ims:organizations/ims:organization/ims:item/@identifierref | @identifierref">\r
17       <assert test="(ims:organizations/ims:organization/ims:item/@identifierref | ims:manifest/ims:organizations/ims:organization/ims:item/@identifierref | @identifierref) and not (count(../item)=0)">Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04)</assert>\r
18     </rule>\r
19   </pattern>\r
20   <pattern name="pattern_2">\r
21     <rule context="ims:resources/ims:resource/ims:dependency/@identifierref | ims:manifest/ims:resources/ims:resource/ims:dependency/@identifierref">\r
22       <assert test="(ims:resources/ims:resource/ims:dependency/@identifierref | ims:manifest/ims:resources/ims:resource/ims:dependency/@identifierref) and (../../@type='associatedcontent/imscc_xmlv1p0/learning-application-resource') and not (current() = /manifest/resources/resource[@type='webcontent']/@identifier)">Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03)</assert>\r
23     </rule>\r
24   </pattern>\r
25   <pattern name="pattern_3">\r
26     <rule context="ims:organizations/ims:organization/ims:item/ims:item | ims:manifest/ims:organizations/ims:organization/ims:item/ims:item">\r
27       <assert test="(ims:organizations/ims:organization/ims:item/ims:item | ims:manifest/ims:organizations/ims:organization/ims:item/ims:item) and (@isvisible='false') and not (count(./item)=count(./item[@isvisible='false']))">Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02)</assert>\r
28     </rule>\r
29   </pattern>\r
30   <pattern name="pattern_4">\r
31     <rule context="ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency">\r
32       <assert test="(ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency) and (../@type='imsdt_xmlv1p0') and not (current()/@identifierref = /manifest/resources/resource[@type='webcontent']/@identifier or current()/@identifierref = /manifest/resources/resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier)">Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12)</assert>\r
33     </rule>\r
34   </pattern>\r
35   <pattern name="pattern_5">\r
36     <rule context="ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency">\r
37       <assert test="(ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency) and (../@type='associatedcontent/imscc_xmlv1p0/learning-application-resource') and not (current()/@identifierref = /manifest/resources/resource[@type='webcontent']/@identifier)">Assertion failed for pattern_5. \r
38  The test was: . \r
39  The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency</assert>\r
40     </rule>\r
41   </pattern>\r
42   <pattern name="pattern_6">\r
43     <rule context="ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency">\r
44       <assert test="(ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency) and (../@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment') and not ((current()/@identifierref = /manifest/resources/resource[@type='webcontent']/@identifier) or (current()/@identifierref = /manifest/resources/resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier))">Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14)</assert>\r
45     </rule>\r
46   </pattern>\r
47   <pattern name="pattern_7">\r
48     <rule context="ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource">\r
49       <assert test="(ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource) and ((./@type='webcontent' or ./@type='associatedcontent/imscc_xmlv1p0/learning-application-resource') and ./@identifier = //item/@identifierref) and not (count(./@href)=1)">Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05)</assert>\r
50     </rule>\r
51   </pattern>\r
52   <pattern name="pattern_8">\r
53     <rule context="ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource">\r
54       <assert test="(ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource) and (./@type='imsdt_xmlv1p0') and not (count(./file)=1 and count(./@href)=0)">Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06)</assert>\r
55     </rule>\r
56   </pattern>\r
57   <pattern name="pattern_9">\r
58     <rule context="ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource">\r
59       <assert test="(ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource) and (./@type='imswl_xmlv1p0') and not (count(./file)=1 and count(./dependency)=0 and count(./@href)=0)">Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07)</assert>\r
60     </rule>\r
61   </pattern>\r
62   <pattern name="pattern_10">\r
63     <rule context="ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource">\r
64       <assert test="(ims:resources/ims:resource | ims:manifest/ims:resources/ims:resource) and ((./@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment') or (./@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank')) and not (count(./file)=1 and count(./@href)=0)">Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11)</assert>\r
65     </rule>\r
66   </pattern>\r
67 </schema>\r
68 \r