// expected type is "xs:string?", which is fine for functions that treat an empty
// sequence like a zero-length string, but fails for example on resolve-QName()
// which treats them differently. It would be good to revert to the string() call
// in all cases: or perhaps to a variant of string() that maps () to (). This would
// enable further optimizations.
SystemFunction fn = (SystemFunction)SystemFunction.makeSystemFunction(
"string", new Expression[]{new ContextItemExpression()});
fn.setContainer(getContainer());
ForEach map = new ForEach(nodeExp, fn, false);
map.setContainer(getContainer());
return map;
} else {
SystemFunction fn = (SystemFunction)SystemFunction.makeSystemFunction(
"string", new Expression[]{nodeExp});
fn.setContainer(getContainer());
return fn;
}
}
if (type.equals(BuiltInAtomicType.ANY_ATOMIC) || type instanceof AnyItemType ||
type.equals(BuiltInAtomicType.UNTYPED_ATOMIC)) {