type.equals(BuiltInAtomicType.UNTYPED_ATOMIC) &&
requiredItemType == BuiltInAtomicType.STRING &&
((Atomizer)operand).getBaseExpression().getItemType(th) instanceof NodeTest) {
Expression nodeExp = ((Atomizer)operand).getBaseExpression();
if (Cardinality.allowsMany(nodeExp.getCardinality())) {
SystemFunction fn = (SystemFunction)SystemFunction.makeSystemFunction(
"string", new Expression[]{new ContextItemExpression()});
fn.setContainer(getContainer());
AtomicMappingExpression map = new AtomicMappingExpression(nodeExp, fn);
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)) {