Spurious type-checking errors may be reported. For example
A sequence of more than one item is not allowed as ...
It's hard to be specific about the circumstances. The
(a) the expression is evaluated in "push" mode (which
generally means when the result of the expression is
written to a tree, which may the final result tree)
(b) more than one sequence is type-checked in the same
An example that shows the error is:
for $b in doc("bids.xml")//bid_tuple
return $b/bid treat as element()
where in fact each bid_tuple contains exactly one bid.
Source fix: in
net.sf.saxon.expr.CardinalityChecker.java, line 203, change