Michael Kay - 2006-06-15

Logged In: YES
user_id=251681

The relevant code occurs in two places, one was fixed in
8.7.3, the other was not.

ExpressionParser.java line 454 should read:

if (isKeyword("as") && "XQuery".equals(getLanguage())) {
nextToken();
SequenceType type = parseSequenceType();
clause.requiredType = type;
if (type.getCardinality() !=
StaticProperty.EXACTLY_ONE) {
warning("Occurrence indicator on
singleton range variable has no effect");
type =
SequenceType.makeSequenceType(type.getPrimaryType(),
StaticProperty.EXACTLY_ONE);
}
v.setRequiredType(type);
}

QueryParser line 1687 should read:

        if (isKeyword("as")) {
            nextToken();
            SequenceType type = parseSequenceType();
            if (type.getCardinality() !=

StaticProperty.EXACTLY_ONE) {
warning("Occurrence indicator on
singleton range variable has no effect");
type =
SequenceType.makeSequenceType(type.getPrimaryType(),
StaticProperty.EXACTLY_ONE);
}
v.setRequiredType(type);
}