Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "COSMOS SML Test Plan"

(COSMOS SML and SML-IF Validator Test Plan)
Line 11: Line 11:
 
== Test Suite ==
 
== Test Suite ==
  
=== InvalidCyclesWithAcyclicReferences ===
+
=== Acyclic Tests ===
 +
Tests that check for valid cycles using sml:acyclic
 +
 
 +
==== InvalidCyclesWithAcyclicReferences ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 19: Line 22:
 
This test verifies that it is an error to create cycles with instances of acyclic references
 
This test verifies that it is an error to create cycles with instances of acyclic references
  
=== InvalidDerivationWithAcyclicAttribute ===
+
==== InvalidDerivationWithAcyclicAttribute ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 27: Line 30:
 
A model is invalid if it has a reference type R1 with sml:acyclic=”true” and another reference type R2 derived from R1 such that sml:acyclic=”false”
 
A model is invalid if it has a reference type R1 with sml:acyclic=”true” and another reference type R2 derived from R1 such that sml:acyclic=”false”
  
=== ValidateAcyclicDefinition ===
+
==== ValidateAcyclicDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 35: Line 38:
 
This test returns a warning if the sml:acyclic attribute is defined on an element declaration
 
This test returns a warning if the sml:acyclic attribute is defined on an element declaration
  
=== ValidCyclesWithAcyclicReference1 ===
+
==== ValidCyclesWithAcyclicReference1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 43: Line 46:
 
Let R1 and R2 be two reference types with sml:acyclic=”true”. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2
 
Let R1 and R2 be two reference types with sml:acyclic=”true”. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2
  
=== ValidCyclesWithAcyclicReference2 ===
+
==== ValidCyclesWithAcyclicReference2 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 51: Line 54:
 
Let R1 be a reference type with sml:acyclic=”false”. Then a model is valid if it has inter-document cycles using instances of R1
 
Let R1 be a reference type with sml:acyclic=”false”. Then a model is valid if it has inter-document cycles using instances of R1
  
=== ValidCycles3 ===
+
==== ValidCycles3 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 59: Line 62:
 
This test verifies that it is valid to create cycles within documents, as long as instances of acyclic references do not create cycles.
 
This test verifies that it is valid to create cycles within documents, as long as instances of acyclic references do not create cycles.
  
=== ValidDerivationWithAcyclicAttribute ===
+
==== ValidDerivationWithAcyclicAttribute ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 67: Line 70:
 
A model is valid if it has a reference type R1 with sml:acyclic=”false” and another reference type R2 derived from R1 such that sml:acyclic=”true”
 
A model is valid if it has a reference type R1 with sml:acyclic=”false” and another reference type R2 derived from R1 such that sml:acyclic=”true”
  
=== MultipleDeref ===
+
=== Deref Tests ===
 +
Tests that ensure proper operation of the deref() function
 +
 
 +
==== MultipleDeref ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 75: Line 81:
 
Verify that deref() can accept a node set of reference elements, i.e., elements for which sml:ref=”true”, and return a node set that is union of the element nodes targeted by references in the node set such that the reference targets exactly one element in the model. The returned node set must not contain any nodes for references that do not target an element in the model.
 
Verify that deref() can accept a node set of reference elements, i.e., elements for which sml:ref=”true”, and return a node set that is union of the element nodes targeted by references in the node set such that the reference targets exactly one element in the model. The returned node set must not contain any nodes for references that do not target an element in the model.
  
=== MultipleXpointer ===
+
==== MultipleXpointer ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 83: Line 89:
 
Verify that deref() can resolve references that target non-root elements using XPointer scheme.
 
Verify that deref() can resolve references that target non-root elements using XPointer scheme.
  
=== SingleRef ===
+
==== SingleRef ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 91: Line 97:
 
Verify that deref() can resolve a single reference. The deref() function must return a single node (i.e. a node set with a single node) that corresponds to the element node of the reference’s target when the reference targets a single element in the model.
 
Verify that deref() can resolve a single reference. The deref() function must return a single node (i.e. a node set with a single node) that corresponds to the element node of the reference’s target when the reference targets a single element in the model.
  
=== InValidKeyDuplicate ===
+
=== Identity Tests ===
 +
Tests that validate the resolution of key references to elements
 +
 
 +
==== InValidKeyDuplicate ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 99: Line 108:
 
Verify that a model with a key constraint is invalid if the field values are not unique.
 
Verify that a model with a key constraint is invalid if the field values are not unique.
  
=== InValidKeyMissing ===
+
==== InValidKeyMissing ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 107: Line 116:
 
Verify that a model with a key constraint is invalid if some field values are missing.
 
Verify that a model with a key constraint is invalid if some field values are missing.
  
=== InValidUnique ===
+
==== InValidUnique ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 115: Line 124:
 
Verify that a model with a unique constraint is invalid if the field values are not unique.
 
Verify that a model with a unique constraint is invalid if the field values are not unique.
  
=== InvalidConstraintDefinition ===
+
==== InvalidConstraintDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 123: Line 132:
 
This test returns a warning when the id constraints are defined on a complexType. They should be defined on an element declaration.
 
This test returns a warning when the id constraints are defined on a complexType. They should be defined on an element declaration.
  
=== InvalidConstraintRefAttributes ===
+
==== InvalidConstraintRefAttributes ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 131: Line 140:
 
Verifies that the code returns an error when the name attribute is specified on a constraint with the ref attribute specified. Ref attribute I am referring to here is the one defined on the keybase type. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 1.The name attribute MUST NOT be specified.
 
Verifies that the code returns an error when the name attribute is specified on a constraint with the ref attribute specified. Ref attribute I am referring to here is the one defined on the keybase type. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 1.The name attribute MUST NOT be specified.
  
=== InvalidConstraintRefElements ===
+
==== InvalidConstraintRefElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 139: Line 148:
 
Verifies that the code returns an error when the sml:field and sml:selector child elements are defined on a constraint with the ref attribute specified. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 2.The sml:selector and sml:field child elements MUST NOT be specified.
 
Verifies that the code returns an error when the sml:field and sml:selector child elements are defined on a constraint with the ref attribute specified. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 2.The sml:selector and sml:field child elements MUST NOT be specified.
  
=== InvalidConstraintRefKey ===
+
==== InvalidConstraintRefKey ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 147: Line 156:
 
Verifies that the code returns an error when the key's ref attribute value resolves to an element which is not a key.
 
Verifies that the code returns an error when the key's ref attribute value resolves to an element which is not a key.
  
=== InvalidConstraintRefKeyref ===
+
==== InvalidConstraintRefKeyref ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 155: Line 164:
 
Verifies that the code returns an error when the keyref's ref attribute value resolves to a key element instead of a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]
 
Verifies that the code returns an error when the keyref's ref attribute value resolves to a key element instead of a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]
  
=== InvalidConstraintRefNoKey ===
+
==== InvalidConstraintRefNoKey ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 163: Line 172:
 
Verifies that the code returns an error when the key's ref attribute value doesn't resolve to an SML key constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:key, then the value of ref attribute MUST resolve to an SML key constraint.
 
Verifies that the code returns an error when the key's ref attribute value doesn't resolve to an SML key constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:key, then the value of ref attribute MUST resolve to an SML key constraint.
  
=== InvalidConstraintRefNoKeyRef ===
+
==== InvalidConstraintRefNoKeyRef ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 171: Line 180:
 
Verifies that the code returns an error when the keyref's ref attribute value doesn't resolve to an SML keyref constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint, and the refer attribute MUST NOT be specified.
 
Verifies that the code returns an error when the keyref's ref attribute value doesn't resolve to an SML keyref constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint, and the refer attribute MUST NOT be specified.
  
=== InvalidConstraintRefNoKeyUnique ===
+
==== InvalidConstraintRefNoKeyUnique ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 179: Line 188:
 
Verifies that the code returns an error when the unique's ref attribute value doesn't resolve to an SML unique constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:unique, then the value of the ref attribute MUST resolve to an SML unique constraint.
 
Verifies that the code returns an error when the unique's ref attribute value doesn't resolve to an SML unique constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:unique, then the value of the ref attribute MUST resolve to an SML unique constraint.
  
=== InvalidConstraintRefUnique ===
+
==== InvalidConstraintRefUnique ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 187: Line 196:
 
Verifies that the code returns an error when the unique's ref attribute value resolves to an element that is not of type sml:unique.
 
Verifies that the code returns an error when the unique's ref attribute value resolves to an element that is not of type sml:unique.
  
=== InvalidConstraintSubstitution ===
+
==== InvalidConstraintSubstitution ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 195: Line 204:
 
This test verifies that substitution group elements validate id constraints defined on their group affiliation. If an element declaration S has a {substitution group affiliation} G, then its {SML identity-constraints definitions} also contains members of {SML identity-constraints definitions} of G.
 
This test verifies that substitution group elements validate id constraints defined on their group affiliation. If an element declaration S has a {substitution group affiliation} G, then its {SML identity-constraints definitions} also contains members of {SML identity-constraints definitions} of G.
  
=== InvalidDuplicateConstraintName ===
+
==== InvalidDuplicateConstraintName ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 203: Line 212:
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration).
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration).
  
=== InvalidDuplicateConstraintName1 ===
+
==== InvalidDuplicateConstraintName1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 211: Line 220:
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). The {SML identity-constraints definitions} of an element declaration MUST NOT contain two identity constraints with the same name.
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). The {SML identity-constraints definitions} of an element declaration MUST NOT contain two identity constraints with the same name.
  
=== InvalidDuplicateConstraintSubst ===
+
==== InvalidDuplicateConstraintSubst ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 219: Line 228:
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). If a global element declaration S has a {substitution group affiliation} G, then {SML identity-constraints definitions} of S MUST be a superset of that of G.
 
This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). If a global element declaration S has a {substitution group affiliation} G, then {SML identity-constraints definitions} of S MUST be a superset of that of G.
  
=== ValidConstraintRefKeyref ===
+
==== ValidConstraintRefKeyref ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 227: Line 236:
 
Verifies that the code returns success when the keyref's ref attribute value resolves to a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]
 
Verifies that the code returns success when the keyref's ref attribute value resolves to a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]
  
=== ValidKeyref ===
+
==== ValidKeyref ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 235: Line 244:
 
Verify keyref constraint.
 
Verify keyref constraint.
  
=== ValidKeyUnique ===
+
==== ValidKeyUnique ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 243: Line 252:
 
Verify that a model with a key and unique constraint is valid if the field values are unique, though some field values for the unique constraint may be missing.
 
Verify that a model with a key and unique constraint is valid if the field values are unique, though some field values for the unique constraint may be missing.
  
=== ValidKeyUniqueInScopeOnly ===
+
==== ValidKeyUniqueInScopeOnly ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 251: Line 260:
 
Verify that a model with a key and unique constraint is valid if the constraints are satisfied in scope even though the constraints may not be satisfied globally in the model.
 
Verify that a model with a key and unique constraint is valid if the constraints are satisfied in scope even though the constraints may not be satisfied globally in the model.
  
=== InValidInCompleteModel ===
+
=== Incomplete Tests ===
 +
Tests that check for the completeness of the model
 +
 
 +
==== InValidInCompleteModel ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 259: Line 271:
 
This test verifies that an incomplete model is invalid
 
This test verifies that an incomplete model is invalid
  
=== InValidInCompleteModel ===
+
=== Miscellaneous Tests ===
 +
Tests that check miscellaneous issues to ensure valid SML documents
  
=== TDM synthetic example converted to use SML ===
+
==== InValidInCompleteModel ====
 +
 
 +
==== TDM synthetic example converted to use SML ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 269: Line 284:
 
Describes a database hosted on a windows XP operating system
 
Describes a database hosted on a windows XP operating system
  
=== TDM synthetic example converted to use SML ===
+
==== TDM synthetic example converted to use SML ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 277: Line 292:
 
Describes a database hosted on a windows XP operating system
 
Describes a database hosted on a windows XP operating system
  
=== ValidSchematronRule ===
+
==== ValidSchematronRule ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 285: Line 300:
 
A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.
 
A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.
  
=== InvalidRefOneSchemeResolves ===
+
=== Reference Tests ===
 +
Tests that validate the implementation of sml:ref
 +
 
 +
==== InvalidRefOneSchemeResolves ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 293: Line 311:
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, resolving to two different elements.
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, resolving to two different elements.
  
=== InvalidRefResolvesToMultipleElements ===
+
==== InvalidRefResolvesToMultipleElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 301: Line 319:
 
Every non-null reference MUST target at most one element in a model. When a recognized scheme in a reference resolves to more than one target then the model MUST be declared invalid. This test verifies that the code returns an error when an SML references contains a reference scheme that resolves to more than one element.
 
Every non-null reference MUST target at most one element in a model. When a recognized scheme in a reference resolves to more than one target then the model MUST be declared invalid. This test verifies that the code returns an error when an SML references contains a reference scheme that resolves to more than one element.
  
=== InvalidRefTwoSchemes ===
+
==== InvalidRefTwoSchemes ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 309: Line 327:
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, and one scheme resolves while the other doesn't.
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, and one scheme resolves while the other doesn't.
  
=== ValidRefNilrefSpecified1 ===
+
==== ValidRefNilrefSpecified1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 317: Line 335:
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference is to be resolved, the validator will return an exception since the two reference schemes resolve to two different elements. This test should return success because the sml:nilref is specified.
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference is to be resolved, the validator will return an exception since the two reference schemes resolve to two different elements. This test should return success because the sml:nilref is specified.
  
=== ValidRefOneSchemeResolvesOtherUnknown ===
+
==== ValidRefOneSchemeResolvesOtherUnknown ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 325: Line 343:
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, one resolving to a valid target and the other scheme being unknown to the processor.
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, one resolving to a valid target and the other scheme being unknown to the processor.
  
=== ValidRefTwoSchemes ===
+
==== ValidRefTwoSchemes ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 333: Line 351:
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, both resolving to the same target.
 
An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, both resolving to the same target.
  
=== ValidRefTwoSchemesNilSpecified ===
+
==== ValidRefTwoSchemesNilSpecified ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 341: Line 359:
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return an exception since only one reference scheme resolves. This test should return success because the sml:nilref is specified.
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return an exception since only one reference scheme resolves. This test should return success because the sml:nilref is specified.
  
=== ValidRefTwoSchemesReturnsNull ===
+
==== ValidRefTwoSchemesReturnsNull ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 349: Line 367:
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return a non null target element. This test should return success but with a reference target of null.
 
A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return a non null target element. This test should return success but with a reference target of null.
  
=== DanglingRef ===
+
==== DanglingRef ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 357: Line 375:
 
This test verifies that a valid model can contain dangling references
 
This test verifies that a valid model can contain dangling references
  
=== EmptyRefElement ===
+
==== EmptyRefElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 365: Line 383:
 
This test verifies that reference elements can be empty
 
This test verifies that reference elements can be empty
  
=== IntraDocumentRef ===
+
==== IntraDocumentRef ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 373: Line 391:
 
This test verifies that a reference element can target an element in the same document
 
This test verifies that a reference element can target an element in the same document
  
=== MultipleRefToAnElement ===
+
==== MultipleRefToAnElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 381: Line 399:
 
This test verifies that an element can be targeted by multiple different references
 
This test verifies that an element can be targeted by multiple different references
  
=== NullRefElement ===
+
==== NullRefElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 389: Line 407:
 
This test verifies that reference elements can be null
 
This test verifies that reference elements can be null
  
=== InvalidNillRefDefinition ===
+
==== InvalidNillRefDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 397: Line 415:
 
This test verifies that sml:nilref attribute is only defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.
 
This test verifies that sml:nilref attribute is only defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.
  
=== InvalidNillRefDefinition ===
+
==== InvalidNillRefDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 405: Line 423:
 
This test verifies that sml:nilref attribute can only be defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.
 
This test verifies that sml:nilref attribute can only be defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.
  
=== RefToNonRootElement ===
+
==== RefToNonRootElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 413: Line 431:
 
This test verifies that a reference element in a document can target non-root elements in some other document
 
This test verifies that a reference element in a document can target non-root elements in some other document
  
=== RefToRootElement ===
+
==== RefToRootElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 421: Line 439:
 
This test verifies that a reference element in a document can target the root element in some other document
 
This test verifies that a reference element in a document can target the root element in some other document
  
=== InvalidSchemeDerefUsed ===
+
==== InvalidSchemeDerefUsed ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 429: Line 447:
 
This test verifies that the code returns error when an smlxpath1 scheme contains a deref() in the evaluator. The deref() XPath extension function MUST NOT be present in the expression evaluation context function library when processing the location path in SMLXPath1_SchemeData : SMLXPath1_Fragment_ID ::= 'smlxpath1' '(' SMLXPath1_SchemeData ')' SMLXPath1_SchemeData ::= XPath1.0_LocationPath
 
This test verifies that the code returns error when an smlxpath1 scheme contains a deref() in the evaluator. The deref() XPath extension function MUST NOT be present in the expression evaluation context function library when processing the location path in SMLXPath1_SchemeData : SMLXPath1_Fragment_ID ::= 'smlxpath1' '(' SMLXPath1_SchemeData ')' SMLXPath1_SchemeData ::= XPath1.0_LocationPath
  
=== InvaliSchemeNamespaceUnknown ===
+
==== InvaliSchemeNamespaceUnknown ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 437: Line 455:
 
This test verifies that the code returns error when an smlxpath1 scheme uses a namespace not defined in the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
 
This test verifies that the code returns error when an smlxpath1 scheme uses a namespace not defined in the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
  
=== InvalidSchemeResultContainsNonElements ===
+
==== InvalidSchemeResultContainsNonElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 445: Line 463:
 
This test verifies that the code returns error when an smlxpath1 scheme resolves to a set containing non-elements. The element(s) targeted by a scheme instance are obtained by applying the location path in SMLXPath1_SchemeData to the root element of the document in the document context. The result MUST be a set of elements. The set MAY be empty. If the result of applying the location path is something other than a set of elements, then the XPointer result is an error.
 
This test verifies that the code returns error when an smlxpath1 scheme resolves to a set containing non-elements. The element(s) targeted by a scheme instance are obtained by applying the location path in SMLXPath1_SchemeData to the root element of the document in the document context. The result MUST be a set of elements. The set MAY be empty. If the result of applying the location path is something other than a set of elements, then the XPointer result is an error.
  
=== InvalidSchemeSyntaxError ===
+
==== InvalidSchemeSyntaxError ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 453: Line 471:
 
This test verifies that the code returns error when an smlxpath1 location path has an invalid syntax.
 
This test verifies that the code returns error when an smlxpath1 location path has an invalid syntax.
  
=== ValiSchemeNamespaceInherited ===
+
==== ValiSchemeNamespaceInherited ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 461: Line 479:
 
This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
 
This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
  
=== ValiSchemeNamespaceInherited ===
+
==== ValiSchemeNamespaceInherited ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 469: Line 487:
 
This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
 
This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.
  
=== InValidSchematronRule ===
+
=== Rule Tests ===
 +
Tests that ensure that Schematron rules and rule bindings are correctly handled
 +
 
 +
==== InValidSchematronRule ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 477: Line 498:
 
A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule.
 
A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule.
  
=== InValidRuleBinding-MultipleRulesSameDocument ===
+
==== InValidRuleBinding-MultipleRulesSameDocument ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 485: Line 506:
 
Two rules are bound to the same document - both fail.
 
Two rules are bound to the same document - both fail.
  
=== InValidRuleBinding-MultipleRulesSameDocument ===
+
==== InValidRuleBinding-MultipleRulesSameDocument ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 493: Line 514:
 
Two rules are bound to the same document. One passes, one fails.
 
Two rules are bound to the same document. One passes, one fails.
  
=== InValidRuleBinding ===
+
==== InValidRuleBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 501: Line 522:
 
A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents.
 
A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents.
  
=== InValidRuleType ===
+
==== InValidRuleType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 509: Line 530:
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type doesn't satisfy the rule.
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type doesn't satisfy the rule.
  
=== InValidRuleTypeExtension ===
+
==== InValidRuleTypeExtension ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 517: Line 538:
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by extension ) doesn't satisfy the rule.
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by extension ) doesn't satisfy the rule.
  
=== InValidRuleTypeRestriction ===
+
==== InValidRuleTypeRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 525: Line 546:
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by restriction ) doesn't satisfy the rule.
 
A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by restriction ) doesn't satisfy the rule.
  
=== ValidSchematronRule ===
+
==== ValidSchematronRule ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 533: Line 554:
 
A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.
 
A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.
  
=== ValidXMLSchema ===
+
==== ValidXMLSchema ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 541: Line 562:
 
Basic XML Schema file, no SML extensions used.
 
Basic XML Schema file, no SML extensions used.
  
=== ValidRuleBinding ===
+
==== ValidRuleBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 549: Line 570:
 
A model with a Schematron rule that is bound to some instance documents is valid if the rule is satisfied by all bound documents.
 
A model with a Schematron rule that is bound to some instance documents is valid if the rule is satisfied by all bound documents.
  
=== InValidAliasHasFragmentComp ===
+
=== SML-IF 1.1 Tests ===
 +
Tests that validate the implementation of new SML-IF 1.1 conditions and features
 +
 
 +
==== InValidAliasHasFragmentComp ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 557: Line 581:
 
This test verifies that the code returns an error when an alias contains a fragment component.
 
This test verifies that the code returns an error when an alias contains a fragment component.
  
=== InValidAliasValue ===
+
==== InValidAliasValue ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 565: Line 589:
 
This test verifies that the code returns an error when an alias contains an invalid value.
 
This test verifies that the code returns an error when an alias contains an invalid value.
  
=== InvalidBase64Content ===
+
==== InvalidBase64Content ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 573: Line 597:
 
This test verifies that the code returns an error when a document that is a child of the base64Data element is not encoded in Base64 format.
 
This test verifies that the code returns an error when a document that is a child of the base64Data element is not encoded in Base64 format.
  
=== InValidBaseURI ===
+
==== InValidBaseURI ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 581: Line 605:
 
This test verifies that the code returns an error when the base URI is not an absolute URI
 
This test verifies that the code returns an error when the base URI is not an absolute URI
  
=== InValidBaseURIHasFragmentComp ===
+
==== InValidBaseURIHasFragmentComp ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 589: Line 613:
 
This test verifies that the code returns an error when the base URI contains a fragment component.
 
This test verifies that the code returns an error when the base URI contains a fragment component.
  
=== InvalidDataContentBase64 ===
+
==== InvalidDataContentBase64 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 597: Line 621:
 
This test verifies that the code returns an error when a document that is a child of the data element is encoded in base64 format.
 
This test verifies that the code returns an error when a document that is a child of the data element is encoded in base64 format.
  
=== InValidDuplicateAliases ===
+
==== InValidDuplicateAliases ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 605: Line 629:
 
This test verifies that the code returns an error when two aliases resolve to the same URI
 
This test verifies that the code returns an error when two aliases resolve to the same URI
  
=== InValidMissingBaseURIAttr1 ===
+
==== InValidMissingBaseURIAttr1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 613: Line 637:
 
This test verifies that the code returns an error when there is relative reference in a document and the baseURI is not defined.
 
This test verifies that the code returns an error when there is relative reference in a document and the baseURI is not defined.
  
=== InvalidMultipleDocument ===
+
==== InvalidMultipleDocument ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 621: Line 645:
 
This test verifies that the code returns an error if the data element contains more than one document.
 
This test verifies that the code returns an error if the data element contains more than one document.
  
=== ValidateDefaultSchemaBinding ===
+
==== ValidateDefaultSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 629: Line 653:
 
This test verifies that the code is using the defaultSchema information to locate the definition file for instance documents not included in schemaBinding. In this sample, the Course1 and Course2 instances should be validated against the University.xsd schema. Course3 will be validated against the Univerity_v1.xsd schema since Course3 is not included in any schemaBinding element.
 
This test verifies that the code is using the defaultSchema information to locate the definition file for instance documents not included in schemaBinding. In this sample, the Course1 and Course2 instances should be validated against the University.xsd schema. Course3 will be validated against the Univerity_v1.xsd schema since Course3 is not included in any schemaBinding element.
  
=== ValidateNoSchemaBinding ===
+
==== ValidateNoSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 637: Line 661:
 
If a namespace ns is not included in any schemaBinding or defaultSchema element, then the schema defining this namespace is built by composing all definition documents whose target namespace matches ns. This resulted schema will be used to validate any instance document using ns namespace. The test should return an error on acyclic
 
If a namespace ns is not included in any schemaBinding or defaultSchema element, then the schema defining this namespace is built by composing all definition documents whose target namespace matches ns. This resulted schema will be used to validate any instance document using ns namespace. The test should return an error on acyclic
  
=== ValidateSchemaBinding ===
+
==== ValidateSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 645: Line 669:
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
  
=== ValidateSchemaBinding ===
+
==== ValidateSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 653: Line 677:
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
  
=== ValidateSchemaBinding ===
+
==== ValidateSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 661: Line 685:
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
  
=== ValidateSchemaBinding ===
+
==== ValidateSchemaBinding ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 669: Line 693:
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
 
This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )
  
=== ValidBase64Content ===
+
==== ValidBase64Content ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 677: Line 701:
 
This test verifies that the code returns success when a document that is a child of the base64Data element is encoded in Base64 format.
 
This test verifies that the code returns success when a document that is a child of the base64Data element is encoded in Base64 format.
  
=== ValidEmptyDocument ===
+
==== ValidEmptyDocument ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 685: Line 709:
 
This test verifies that it is valid to have an empty document.
 
This test verifies that it is valid to have an empty document.
  
=== ValidMissingBaseURIAttr1 ===
+
==== ValidMissingBaseURIAttr1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 693: Line 717:
 
This test verifies that it is valid to not define the baseURI when there is no relative URI defined within any document.
 
This test verifies that it is valid to not define the baseURI when there is no relative URI defined within any document.
  
=== ValidMissingBaseURIAttr2 ===
+
==== ValidMissingBaseURIAttr2 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 701: Line 725:
 
This test verifies that it is valid to have no baseURI, no aliases and a relative reference in a document, if the reference contains only a fragment component. In which case the reference points to an element within the same document.
 
This test verifies that it is valid to have no baseURI, no aliases and a relative reference in a document, if the reference contains only a fragment component. In which case the reference points to an element within the same document.
  
=== InValidTargetElement ===
+
=== SML Model Unit Tests ===
 +
Tests that ensure proper validation of individual SML resources that are not part of an SML-IF file
 +
 
 +
=== Target Element Tests ===
 +
Tests that ensure correct implementation of targetElement
 +
 
 +
==== InValidTargetElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 709: Line 739:
 
If targetElement=”GTE” for a global element declaration E, then a model is invalid if the target of some instance of E in the model is not an instance of GTE.
 
If targetElement=”GTE” for a global element declaration E, then a model is invalid if the target of some instance of E in the model is not an instance of GTE.
  
=== InValidDerivationByRestriction ===
+
==== InValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 717: Line 747:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetElement} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetElement} as the EnrolledCourse element contained by the StudentType.
  
=== InValidSameNameElements ===
+
==== InValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 725: Line 755:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {targetElement}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {targetElement}.
  
=== ValidateTargetElementExists2 ===
+
==== ValidateTargetElementExists2 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 733: Line 763:
 
This test verifies that the value of the sml:targetElement is a global element. Returns an error if the value does not match any element in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetElement, regardless of the instances being defined in that model)
 
This test verifies that the value of the sml:targetElement is a global element. Returns an error if the value does not match any element in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetElement, regardless of the instances being defined in that model)
  
=== InValidTargetElementWithSubstitutionGroup ===
+
==== InValidTargetElementWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 741: Line 771:
 
Let targetElement=”GTE” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetElement attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of GTE or an instance of some GED in the substitution group hierarchy whose head is GTE.
 
Let targetElement=”GTE” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetElement attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of GTE or an instance of some GED in the substitution group hierarchy whose head is GTE.
  
=== ValidTargetElement ===
+
==== ValidTargetElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 749: Line 779:
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
  
=== ValidateTargetElementDefinition ===
+
==== ValidateTargetElementDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 757: Line 787:
 
This test returns a warning if the sml:targetElement attribute is defined on a type definition.
 
This test returns a warning if the sml:targetElement attribute is defined on a type definition.
  
=== ValidDerivationByRestriction ===
+
==== ValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 765: Line 795:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetElement} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetElement} as the EnrolledCourse element contained by the StudentType.
  
=== ValidSameNameElements ===
+
==== ValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 773: Line 803:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {targetElement}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {targetElement}.
  
=== ValidTargetElementWithSubstitutionGroup ===
+
==== ValidTargetElementWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 781: Line 811:
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
  
=== ValidTargetElement ===
+
=== Target Required Tests ===
 +
Tests that ensure correct validation of sml:targetRequired attribute
 +
 
 +
==== ValidTargetElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 789: Line 822:
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
  
=== InValidDerivationByRestriction ===
+
==== InValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 797: Line 830:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {target required} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {target required} as the EnrolledCourse element contained by the StudentType.
  
=== InValidSameNameElements ===
+
==== InValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 805: Line 838:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target required}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target required}.
  
=== ValidTargetType ===
+
==== ValidTargetType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 813: Line 846:
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
  
=== ValidTargetElementWithSubstitutionGroup ===
+
==== ValidTargetElementWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 821: Line 854:
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
  
=== ValidTargetElement ===
+
==== ValidTargetElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 829: Line 862:
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
  
=== ValidateTargetRequireDefinition ===
+
==== ValidateTargetRequireDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 837: Line 870:
 
This test returns a warning if the sml:targetRequired attribute is defined on a type definition.
 
This test returns a warning if the sml:targetRequired attribute is defined on a type definition.
  
=== ValidDerivationByRestriction ===
+
==== ValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 845: Line 878:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {target required} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {target required} as the EnrolledCourse element contained by the StudentType.
  
=== ValidTargetElement ===
+
==== ValidTargetElement ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 853: Line 886:
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
 
If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.
  
=== ValidSameNameElements ===
+
==== ValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 861: Line 894:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {target required}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {target required}.
  
=== ValidTargetType ===
+
==== ValidTargetType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 869: Line 902:
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
  
=== ValidTargetType ===
+
==== ValidTargetType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 877: Line 910:
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
  
=== ValidTargetElementWithSubstitutionGroup ===
+
==== ValidTargetElementWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 885: Line 918:
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
  
=== ValidTargetElementWithSubstitutionGroup ===
+
==== ValidTargetElementWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 893: Line 926:
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
 
If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE
  
=== InValidTargetType ===
+
=== Target Type Tests ===
 +
Tests that ensure correct validation of targetType
 +
 
 +
==== InValidTargetType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 901: Line 937:
 
If targetType=”T” for a global element declaration E, then a model is invalid if the type of the target of some instance of E in the model is not T
 
If targetType=”T” for a global element declaration E, then a model is invalid if the type of the target of some instance of E in the model is not T
  
=== InValidDerivationByRestriction ===
+
==== InValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 909: Line 945:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetType} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetType} as the EnrolledCourse element contained by the StudentType.
  
=== InValidSameNameElements ===
+
==== InValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 917: Line 953:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target type}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target type}.
  
=== ValidateTargetTypeExists1 ===
+
==== ValidateTargetTypeExists1 ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 925: Line 961:
 
This test verifies that the value of the sml:targetType resolves to a global type definition. Returns an error if the value does not match any type in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetType, regardless of the instances being defined in that model)
 
This test verifies that the value of the sml:targetType resolves to a global type definition. Returns an error if the value does not match any type in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetType, regardless of the instances being defined in that model)
  
=== InValidTargetTypeWithSubstitutionGroup ===
+
==== InValidTargetTypeWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 933: Line 969:
 
Let targetType=”T” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of T or an instance of some derived type of T.
 
Let targetType=”T” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of T or an instance of some derived type of T.
  
=== ValidTargetType ===
+
==== ValidTargetType ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 941: Line 977:
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
 
If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T
  
=== ValidateTargetTypeDefinition ===
+
==== ValidateTargetTypeDefinition ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 949: Line 985:
 
This test returns a warning if the sml:targetType attribute is defined on a type definition.
 
This test returns a warning if the sml:targetType attribute is defined on a type definition.
  
=== ValidDerivationByRestriction ===
+
==== ValidDerivationByRestriction ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 957: Line 993:
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetType} as the EnrolledCourse element contained by the StudentType.
 
If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetType} as the EnrolledCourse element contained by the StudentType.
  
=== ValidSameNameElements ===
+
==== ValidSameNameElements ====
  
 
<b>File:</b>
 
<b>File:</b>
Line 965: Line 1,001:
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup have the same {target type}.
 
If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup have the same {target type}.
  
=== ValidTargetTypeWithSubstitutionGroup ===
+
==== ValidTargetTypeWithSubstitutionGroup ====
  
 
<b>File:</b>
 
<b>File:</b>

Revision as of 09:33, 11 March 2008

Contents

COSMOS SML and SML-IF Validator Test Plan

Version 1.0, 10 March 2008

Author: David Whiteman

Introduction

The goal of this test plan is to document the test coverage for the SML and SML-IF validator found in the Eclipse COSMOS project. Using this document, we will describe the test suite used to achieve compliance with the SML and SML-IF 1.1 specifications.

Test Suite

Acyclic Tests

Tests that check for valid cycles using sml:acyclic

InvalidCyclesWithAcyclicReferences

File: acyclic\InValidCycles.xml (src)

Descripton: This test verifies that it is an error to create cycles with instances of acyclic references

InvalidDerivationWithAcyclicAttribute

File: acyclic\InValidDerivation.xml (src)

Descripton: A model is invalid if it has a reference type R1 with sml:acyclic=”true” and another reference type R2 derived from R1 such that sml:acyclic=”false”

ValidateAcyclicDefinition

File: acyclic\ValidateDefinition.xml (src)

Descripton: This test returns a warning if the sml:acyclic attribute is defined on an element declaration

ValidCyclesWithAcyclicReference1

File: acyclic\ValidCycles1.xml (src)

Descripton: Let R1 and R2 be two reference types with sml:acyclic=”true”. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2

ValidCyclesWithAcyclicReference2

File: acyclic\ValidCycles2.xml (src)

Descripton: Let R1 be a reference type with sml:acyclic=”false”. Then a model is valid if it has inter-document cycles using instances of R1

ValidCycles3

File: acyclic\ValidCycles3.xml (src)

Descripton: This test verifies that it is valid to create cycles within documents, as long as instances of acyclic references do not create cycles.

ValidDerivationWithAcyclicAttribute

File: acyclic\ValidDerivation.xml (src)

Descripton: A model is valid if it has a reference type R1 with sml:acyclic=”false” and another reference type R2 derived from R1 such that sml:acyclic=”true”

Deref Tests

Tests that ensure proper operation of the deref() function

MultipleDeref

File: deref\Multiple.xml (src)

Descripton: Verify that deref() can accept a node set of reference elements, i.e., elements for which sml:ref=”true”, and return a node set that is union of the element nodes targeted by references in the node set such that the reference targets exactly one element in the model. The returned node set must not contain any nodes for references that do not target an element in the model.

MultipleXpointer

File: deref\MultipleNonRoot.xml (src)

Descripton: Verify that deref() can resolve references that target non-root elements using XPointer scheme.

SingleRef

File: deref\Single.xml (src)

Descripton: Verify that deref() can resolve a single reference. The deref() function must return a single node (i.e. a node set with a single node) that corresponds to the element node of the reference’s target when the reference targets a single element in the model.

Identity Tests

Tests that validate the resolution of key references to elements

InValidKeyDuplicate

File: identity\InValidKeyDuplicate.xml (src)

Descripton: Verify that a model with a key constraint is invalid if the field values are not unique.

InValidKeyMissing

File: identity\InValidKeyMissing.xml (src)

Descripton: Verify that a model with a key constraint is invalid if some field values are missing.

InValidUnique

File: identity\InValidUnique.xml (src)

Descripton: Verify that a model with a unique constraint is invalid if the field values are not unique.

InvalidConstraintDefinition

File: identity\LC\InValidConstraintDefinition.xml (src)

Descripton: This test returns a warning when the id constraints are defined on a complexType. They should be defined on an element declaration.

InvalidConstraintRefAttributes

File: identity\LC\InValidConstraintRefAttributes.xml (src)

Descripton: Verifies that the code returns an error when the name attribute is specified on a constraint with the ref attribute specified. Ref attribute I am referring to here is the one defined on the keybase type. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 1.The name attribute MUST NOT be specified.

InvalidConstraintRefElements

File: identity\LC\InValidConstraintRefElements.xml (src)

Descripton: Verifies that the code returns an error when the sml:field and sml:selector child elements are defined on a constraint with the ref attribute specified. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: 2.The sml:selector and sml:field child elements MUST NOT be specified.

InvalidConstraintRefKey

File: identity\LC\InValidConstraintRefKey.xml (src)

Descripton: Verifies that the code returns an error when the key's ref attribute value resolves to an element which is not a key.

InvalidConstraintRefKeyref

File: identity\LC\InValidConstraintRefKeyref.xml (src)

Descripton: Verifies that the code returns an error when the keyref's ref attribute value resolves to a key element instead of a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]

InvalidConstraintRefNoKey

File: identity\LC\InValidConstraintRefNoKey.xml (src)

Descripton: Verifies that the code returns an error when the key's ref attribute value doesn't resolve to an SML key constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:key, then the value of ref attribute MUST resolve to an SML key constraint.

InvalidConstraintRefNoKeyRef

File: identity\LC\InValidConstraintRefNoKeyref.xml (src)

Descripton: Verifies that the code returns an error when the keyref's ref attribute value doesn't resolve to an SML keyref constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint, and the refer attribute MUST NOT be specified.

InvalidConstraintRefNoKeyUnique

File: identity\LC\InValidConstraintRefNoUnique.xml (src)

Descripton: Verifies that the code returns an error when the unique's ref attribute value doesn't resolve to an SML unique constraint. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If the element is sml:unique, then the value of the ref attribute MUST resolve to an SML unique constraint.

InvalidConstraintRefUnique

File: identity\LC\InValidConstraintRefUnique.xml (src)

Descripton: Verifies that the code returns an error when the unique's ref attribute value resolves to an element that is not of type sml:unique.

InvalidConstraintSubstitution

File: identity\LC\InValidConstraintSubstitution.xml (src)

Descripton: This test verifies that substitution group elements validate id constraints defined on their group affiliation. If an element declaration S has a {substitution group affiliation} G, then its {SML identity-constraints definitions} also contains members of {SML identity-constraints definitions} of G.

InvalidDuplicateConstraintName

File: identity\LC\InValidDuplicateConstraintName.xml (src)

Descripton: This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration).

InvalidDuplicateConstraintName1

File: identity\LC\InValidDuplicateConstraintName1.xml (src)

Descripton: This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). The {SML identity-constraints definitions} of an element declaration MUST NOT contain two identity constraints with the same name.

InvalidDuplicateConstraintSubst

File: identity\LC\InValidDuplicateConstraintNameSubst.xml (src)

Descripton: This test verifies that the code returns a error when two constraints defined on an element have the same name ( Constraints should have unique names; ie there cannot be an sml:key that has the same name with a sml:key, sml:keyref or sml:unique on the same element declaration). If a global element declaration S has a {substitution group affiliation} G, then {SML identity-constraints definitions} of S MUST be a superset of that of G.

ValidConstraintRefKeyref

File: identity\LC\ValidConstraintRefKeyref.xml (src)

Descripton: Verifies that the code returns success when the keyref's ref attribute value resolves to a keyref element. For each sml:key, sml:unique, or sml:keyref element with the ref attribute specified, {SML identity-constraints definitions} contains the component resolved to by the actual value of the ref attribute, with the following conditions: If element is sml:keyref, then the value of the ref attribute MUST resolve to an SML keyref constraint [..]

ValidKeyref

File: identity\ValidKeyref.xml (src)

Descripton: Verify keyref constraint.

ValidKeyUnique

File: identity\ValidKeyUnique.xml (src)

Descripton: Verify that a model with a key and unique constraint is valid if the field values are unique, though some field values for the unique constraint may be missing.

ValidKeyUniqueInScopeOnly

File: identity\ValidKeyUniqueInScopeOnly.xml (src)

Descripton: Verify that a model with a key and unique constraint is valid if the constraints are satisfied in scope even though the constraints may not be satisfied globally in the model.

Incomplete Tests

Tests that check for the completeness of the model

InValidInCompleteModel

File: incomplete\InValid.xml (src)

Descripton: This test verifies that an incomplete model is invalid

Miscellaneous Tests

Tests that check miscellaneous issues to ensure valid SML documents

InValidInCompleteModel

TDM synthetic example converted to use SML

File: others\rulesWithMultiplePattern.xml (src)

Descripton: Describes a database hosted on a windows XP operating system

TDM synthetic example converted to use SML

File: others\rulesWithMultipleRulesUnderOnePattern.xml (src)

Descripton: Describes a database hosted on a windows XP operating system

ValidSchematronRule

File: others\schemaValidationFailure.xml (src)

Descripton: A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.

Reference Tests

Tests that validate the implementation of sml:ref

InvalidRefOneSchemeResolves

File: references\ConsistentReferences\InvalidRefOneSchemeResolves.xml (src)

Descripton: An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, resolving to two different elements.

InvalidRefResolvesToMultipleElements

File: references\ConsistentReferences\InvalidRefResolvesToMultipleElements.xml (src)

Descripton: Every non-null reference MUST target at most one element in a model. When a recognized scheme in a reference resolves to more than one target then the model MUST be declared invalid. This test verifies that the code returns an error when an SML references contains a reference scheme that resolves to more than one element.

InvalidRefTwoSchemes

File: references\ConsistentReferences\InvalidRefTwoSchemes.xml (src)

Descripton: An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns an error when an SML references contains two reference scheme, and one scheme resolves while the other doesn't.

ValidRefNilrefSpecified1

File: references\ConsistentReferences\ValidRefNilrefSpecified1.xml (src)

Descripton: A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference is to be resolved, the validator will return an exception since the two reference schemes resolve to two different elements. This test should return success because the sml:nilref is specified.

ValidRefOneSchemeResolvesOtherUnknown

File: references\ConsistentReferences\ValidRefOneSchemeResolvesOtherUnknown.xml (src)

Descripton: An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, one resolving to a valid target and the other scheme being unknown to the processor.

ValidRefTwoSchemes

File: references\ConsistentReferences\ValidRefTwoSchemes.xml (src)

Descripton: An SML model MUST be declared invalid when a recognized scheme resolves to a target that's different from the target resolved to by another recognized scheme or when one recognized scheme resolves and another does not. This test verifies that the code returns success when an SML references contains two reference scheme, both resolving to the same target.

ValidRefTwoSchemesNilSpecified

File: references\ConsistentReferences\ValidRefTwoSchemesNilSpecified.xml (src)

Descripton: A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return an exception since only one reference scheme resolves. This test should return success because the sml:nilref is specified.

ValidRefTwoSchemesReturnsNull

File: references\ConsistentReferences\ValidRefTwoSchemesReturnsNull.xml (src)

Descripton: A null reference is an explicit declaration of intent by the document author that the reference itself does not exist, and a processing directive (not a hint) to processors not to attempt to recognize any reference schemes in it.If a reference element is recognized as null, then processors MUST NOT attempt to resolve it. The question of whether a null reference is resolved or not is undefined; it is an ill-formed question. This test verifies that the validator does not try to resolve a reference that is marked as null. If the reference below is to be resolved, the validator will return a non null target element. This test should return success but with a reference target of null.

DanglingRef

File: references\DanglingRef.xml (src)

Descripton: This test verifies that a valid model can contain dangling references

EmptyRefElement

File: references\EmptyRefElement.xml (src)

Descripton: This test verifies that reference elements can be empty

IntraDocumentRef

File: references\IntraDocumentRef.xml (src)

Descripton: This test verifies that a reference element can target an element in the same document

MultipleRefToAnElement

File: references\MultipleRefToAnElement.xml (src)

Descripton: This test verifies that an element can be targeted by multiple different references

NullRefElement

File: references\NullRefElement.xml (src)

Descripton: This test verifies that reference elements can be null

InvalidNillRefDefinition

File: references\NullReferences\InvalidNilRefDefinition.xml (src)

Descripton: This test verifies that sml:nilref attribute is only defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.

InvalidNillRefDefinition

File: references\NullReferences\ValidNilRefDefinition.xml (src)

Descripton: This test verifies that sml:nilref attribute can only be defined on instance elements with sml:ref="true" specified. This global attribute is used to identify null reference elements. This attribute MUST NOT be used on an element unless it also has sml:ref="true" specified.

RefToNonRootElement

File: references\RefToNonRootElement.xml (src)

Descripton: This test verifies that a reference element in a document can target non-root elements in some other document

RefToRootElement

File: references\RefToRootElement.xml (src)

Descripton: This test verifies that a reference element in a document can target the root element in some other document

InvalidSchemeDerefUsed

File: references\smlxpath1Scheme\InvalidSchemeDerefUsed.xml (src)

Descripton: This test verifies that the code returns error when an smlxpath1 scheme contains a deref() in the evaluator. The deref() XPath extension function MUST NOT be present in the expression evaluation context function library when processing the location path in SMLXPath1_SchemeData : SMLXPath1_Fragment_ID ::= 'smlxpath1' '(' SMLXPath1_SchemeData ')' SMLXPath1_SchemeData ::= XPath1.0_LocationPath

InvaliSchemeNamespaceUnknown

File: references\smlxpath1Scheme\InvalidSchemeNamespaceUnknown.xml (src)

Descripton: This test verifies that the code returns error when an smlxpath1 scheme uses a namespace not defined in the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.

InvalidSchemeResultContainsNonElements

File: references\smlxpath1Scheme\InvalidSchemeResultContainsNonElements.xml (src)

Descripton: This test verifies that the code returns error when an smlxpath1 scheme resolves to a set containing non-elements. The element(s) targeted by a scheme instance are obtained by applying the location path in SMLXPath1_SchemeData to the root element of the document in the document context. The result MUST be a set of elements. The set MAY be empty. If the result of applying the location path is something other than a set of elements, then the XPointer result is an error.

InvalidSchemeSyntaxError

File: references\smlxpath1Scheme\InvalidSchemeSyntaxError.xml (src)

Descripton: This test verifies that the code returns error when an smlxpath1 location path has an invalid syntax.

ValiSchemeNamespaceInherited

File: references\smlxpath1Scheme\ValidSchemeNamespaceInherited.xml (src)

Descripton: This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.

ValiSchemeNamespaceInherited

File: references\smlxpath1Scheme\ValidSchemeNamespaceInherited1.xml (src)

Descripton: This test verifies that the code returns success when an smlxpath1 scheme uses a namespace defined by the containing element. Namespace Binding Context: The smlxpath1() scheme inherits the set of namespace bindings available to the containing element.

Rule Tests

Tests that ensure that Schematron rules and rule bindings are correctly handled

InValidSchematronRule

File: Rules\InValid.xml (src)

Descripton: A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule.

InValidRuleBinding-MultipleRulesSameDocument

File: Rules\InValidRuleBinding-MultipleRulesSameDocument-BothFail.xml (src)

Descripton: Two rules are bound to the same document - both fail.

InValidRuleBinding-MultipleRulesSameDocument

File: Rules\InValidRuleBinding-MultipleRulesSameDocument.xml (src)

Descripton: Two rules are bound to the same document. One passes, one fails.

InValidRuleBinding

File: Rules\InValidRuleBinding.xml (src)

Descripton: A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents.

InValidRuleType

File: Rules\InValidRuleType.xml (src)

Descripton: A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type doesn't satisfy the rule.

InValidRuleTypeExtension

File: Rules\InValidRuleTypeExtension.xml (src)

Descripton: A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by extension ) doesn't satisfy the rule.

InValidRuleTypeRestriction

File: Rules\InValidRuleTypeRestriction.xml (src)

Descripton: A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by restriction ) doesn't satisfy the rule.

ValidSchematronRule

File: Rules\Valid.xml (src)

Descripton: A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule.

ValidXMLSchema

File: Rules\ValidNoSML.xml (src)

Descripton: Basic XML Schema file, no SML extensions used.

ValidRuleBinding

File: Rules\ValidRuleBinding.xml (src)

Descripton: A model with a Schematron rule that is bound to some instance documents is valid if the rule is satisfied by all bound documents.

SML-IF 1.1 Tests

Tests that validate the implementation of new SML-IF 1.1 conditions and features

InValidAliasHasFragmentComp

File: smlif_lc\InValidAliasHasFragmentComp.xml (src)

Descripton: This test verifies that the code returns an error when an alias contains a fragment component.

InValidAliasValue

File: smlif_lc\InValidAliasValue.xml (src)

Descripton: This test verifies that the code returns an error when an alias contains an invalid value.

InvalidBase64Content

File: smlif_lc\InvalidBase64Content.xml (src)

Descripton: This test verifies that the code returns an error when a document that is a child of the base64Data element is not encoded in Base64 format.

InValidBaseURI

File: smlif_lc\InValidBaseURI.xml (src)

Descripton: This test verifies that the code returns an error when the base URI is not an absolute URI

InValidBaseURIHasFragmentComp

File: smlif_lc\InValidBaseURIHasFragmentComp.xml (src)

Descripton: This test verifies that the code returns an error when the base URI contains a fragment component.

InvalidDataContentBase64

File: smlif_lc\InvalidDataContentBase64.xml (src)

Descripton: This test verifies that the code returns an error when a document that is a child of the data element is encoded in base64 format.

InValidDuplicateAliases

File: smlif_lc\InValidDuplicateAliases.xml (src)

Descripton: This test verifies that the code returns an error when two aliases resolve to the same URI

InValidMissingBaseURIAttr1

File: smlif_lc\InValidMissingBaseURIAttr.xml (src)

Descripton: This test verifies that the code returns an error when there is relative reference in a document and the baseURI is not defined.

InvalidMultipleDocument

File: smlif_lc\InValidMultipleDocument.xml (src)

Descripton: This test verifies that the code returns an error if the data element contains more than one document.

ValidateDefaultSchemaBinding

File: smlif_lc\ValidateDefaultSchemaBinding.xml (src)

Descripton: This test verifies that the code is using the defaultSchema information to locate the definition file for instance documents not included in schemaBinding. In this sample, the Course1 and Course2 instances should be validated against the University.xsd schema. Course3 will be validated against the Univerity_v1.xsd schema since Course3 is not included in any schemaBinding element.

ValidateNoSchemaBinding

File: smlif_lc\ValidateNoSchemaBinding.xml (src)

Descripton: If a namespace ns is not included in any schemaBinding or defaultSchema element, then the schema defining this namespace is built by composing all definition documents whose target namespace matches ns. This resulted schema will be used to validate any instance document using ns namespace. The test should return an error on acyclic

ValidateSchemaBinding

File: smlif_lc\ValidateSchemaBinding.xml (src)

Descripton: This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )

ValidateSchemaBinding

File: smlif_lc\ValidateSchemaBinding1.xml (src)

Descripton: This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )

ValidateSchemaBinding

File: smlif_lc\ValidateSchemaBinding2.xml (src)

Descripton: This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )

ValidateSchemaBinding

File: smlif_lc\ValidateSchemaBinding3.xml (src)

Descripton: This test verifies that the code is using the schemaBinding information to locate the definition file for instance documents. In this sample, there are two xsd files with the same namespace, tns. The instance documents are bound to the first xsd definition, University.xsd using the schemaBinding element. As a result, the validation should be run using the schema defined in University.xsd and ignore University_v1.xsd. The validation returns success since Univesity.xsd does not have the acyclic attribute specified on the OptionalCourseRefType type. If the schemaBinding is ignored, then the validator should return error ( the schema file used to validate the instances will be composed from both xsd files; the first definition of the OptionalCourseRefType type in the University.xsd will be overwritten by the OptionalCourseRefType - acyclic = true in the University_v1.xsd )

ValidBase64Content

File: smlif_lc\ValidBase64Content.xml (src)

Descripton: This test verifies that the code returns success when a document that is a child of the base64Data element is encoded in Base64 format.

ValidEmptyDocument

File: smlif_lc\ValidEmptyDocument.xml (src)

Descripton: This test verifies that it is valid to have an empty document.

ValidMissingBaseURIAttr1

File: smlif_lc\ValidMissingBaseURIAttr1.xml (src)

Descripton: This test verifies that it is valid to not define the baseURI when there is no relative URI defined within any document.

ValidMissingBaseURIAttr2

File: smlif_lc\ValidMissingBaseURIAttr2.xml (src)

Descripton: This test verifies that it is valid to have no baseURI, no aliases and a relative reference in a document, if the reference contains only a fragment component. In which case the reference points to an element within the same document.

SML Model Unit Tests

Tests that ensure proper validation of individual SML resources that are not part of an SML-IF file

Target Element Tests

Tests that ensure correct implementation of targetElement

InValidTargetElement

File: targetElement\InValid.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is invalid if the target of some instance of E in the model is not an instance of GTE.

InValidDerivationByRestriction

File: targetElement\InValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetElement} as the EnrolledCourse element contained by the StudentType.

InValidSameNameElements

File: targetElement\InValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {targetElement}.

ValidateTargetElementExists2

File: targetElement\InvalidValue.xml (src)

Descripton: This test verifies that the value of the sml:targetElement is a global element. Returns an error if the value does not match any element in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetElement, regardless of the instances being defined in that model)

InValidTargetElementWithSubstitutionGroup

File: targetElement\InValidWithSubstitutionGroup.xml (src)

Descripton: Let targetElement=”GTE” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetElement attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of GTE or an instance of some GED in the substitution group hierarchy whose head is GTE.

ValidTargetElement

File: targetElement\Valid.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.

ValidateTargetElementDefinition

File: targetElement\ValidateTargetElementDefinition.xml (src)

Descripton: This test returns a warning if the sml:targetElement attribute is defined on a type definition.

ValidDerivationByRestriction

File: targetElement\ValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetElement} as the EnrolledCourse element contained by the StudentType.

ValidSameNameElements

File: targetElement\ValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {targetElement}.

ValidTargetElementWithSubstitutionGroup

File: targetElement\ValidWithSubstitutionGroup.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE

Target Required Tests

Tests that ensure correct validation of sml:targetRequired attribute

ValidTargetElement

File: targetRequired\InValid.xml (src)

Descripton: If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.

InValidDerivationByRestriction

File: targetRequired\InValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {target required} as the EnrolledCourse element contained by the StudentType.

InValidSameNameElements

File: targetRequired\InValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target required}.

ValidTargetType

File: targetRequired\InValidType.xml (src)

Descripton: If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T

ValidTargetElementWithSubstitutionGroup

File: targetRequired\InValidWithSubstitutionGroup.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE

ValidTargetElement

File: targetRequired\valid.xml (src)

Descripton: If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.

ValidateTargetRequireDefinition

File: targetRequired\ValidateTargetRequiredDefinition.xml (src)

Descripton: This test returns a warning if the sml:targetRequired attribute is defined on a type definition.

ValidDerivationByRestriction

File: targetRequired\ValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target required} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {target required} as the EnrolledCourse element contained by the StudentType.

ValidTargetElement

File: targetRequired\ValidFalseRequire.xml (src)

Descripton: If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE.

ValidSameNameElements

File: targetRequired\ValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {target required}.

ValidTargetType

File: targetRequired\ValidType.xml (src)

Descripton: If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T

ValidTargetType

File: targetRequired\ValidTypeFalse.xml (src)

Descripton: If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T

ValidTargetElementWithSubstitutionGroup

File: targetRequired\ValidWithSubstitutionGroup.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE

ValidTargetElementWithSubstitutionGroup

File: targetRequired\ValidWithSubstitutionGroupFalseRequire.xml (src)

Descripton: If targetElement=”GTE” for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE

Target Type Tests

Tests that ensure correct validation of targetType

InValidTargetType

File: targetType\InValid.xml (src)

Descripton: If targetType=”T” for a global element declaration E, then a model is invalid if the type of the target of some instance of E in the model is not T

InValidDerivationByRestriction

File: targetType\InValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetType} as the EnrolledCourse element contained by the StudentType.

InValidSameNameElements

File: targetType\InValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target type}.

ValidateTargetTypeExists1

File: targetType\InValidValue.xml (src)

Descripton: This test verifies that the value of the sml:targetType resolves to a global type definition. Returns an error if the value does not match any type in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetType, regardless of the instances being defined in that model)

InValidTargetTypeWithSubstitutionGroup

File: targetType\InValidWithSubstitutionGroup.xml (src)

Descripton: Let targetType=”T” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of T or an instance of some derived type of T.

ValidTargetType

File: targetType\Valid.xml (src)

Descripton: If targetType=”T” for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T

ValidateTargetTypeDefinition

File: targetType\ValidateTargetTypeDefinition.xml (src)

Descripton: This test returns a warning if the sml:targetType attribute is defined on a type definition.

ValidDerivationByRestriction

File: targetType\ValidDerivationByRestriction.xml (src)

Descripton: If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetType} as the EnrolledCourse element contained by the StudentType.

ValidSameNameElements

File: targetType\ValidSameNameElements.xml (src)

Descripton: If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup have the same {target type}.

ValidTargetTypeWithSubstitutionGroup

File: targetType\ValidWithSubstitutionGroup.xml (src)

Descripton: Let targetType=”T” be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is valid if all instances of SubE target elements whose type is T.

Back to the top