Modify static type of operand.
A TreatExpr
modifies the static type of its operand and
takes an expression and a sequence type as arguments. It does not change the
dynamic type; rather, it ensures that an expression has an expected dynamic
type at evaluation time.
The static type of $myaddress
may be
Address
, a less specific type than USAddress
.
However, at run-time, the value of $myaddress
must
match the type USAddress
using rules for SequenceType matching;
otherwise a dynamic error is raised.
$myaddress treat as element()
The following construct(s) refer to this construct: