2.1.36.2.4 AssertType Expression
An AssertType expression casts a child element expression to a given type. The result of the AssertType expression is an instance of the specified type or an error. The following two examples show how you can use either the Type attribute or the ReferenceType child element to assert the type.
In example 1, AssertType uses a Type attribute.
-
<AssertType Type="Edm.String"> <String>Tag1</String> </AssertType>
In example 2, AssertType uses a nested ReferenceType element.
-
<AssertType> <ReferenceType Type="Edm.String" /> <String>Tag1</String> </AssertType>
The following rules apply to the AssertType expression:
AssertType MUST define the type, either as an attribute or as a child element ReferenceType.
AssertType MUST contain one expression as a child element. The expression MUST follow ReferenceType if ReferenceType is used to define the type.