[XQuery] What dynamic error does treat expression raise?

The description of the treat expression in the XQuery language draft says:

"During expression evaluation: If expr1 matches type1, using the
SequenceType Matching rules in 2.4 Types, the treat expression returns the
value of expr1; otherwise, it raises a dynamic error.[err:XP0006] "

Then later it says:

"The static type of $myaddress may be element(*, Address), a less specific
type than element(*, USAddress). However, at run-time, the value of
$myaddress must match the type element(*, USAddress) using SequenceType
Matching rules; otherwise a dynamic error is raised.[err:XP0050]"

These seem like the same situation with 2 different error messages (XP0006
and XP0050).

Does the draft contradict itself, or am I misreading?

Thanks,
Priscilla

Received on Friday, 21 November 2003 10:21:16 UTC