boolean isSchemaAware = true;
//Executable exec = getExecutable();
if (!th.getConfiguration().isSchemaAware(Configuration.XML_SCHEMA)) {
isSchemaAware = false;
}
ItemType in = operand.getItemType(th);
if (in.isAtomicType()) {
return in;
}
if (in instanceof NodeTest) {
if (in instanceof EmptySequenceTest) {
return in;
}
int kinds = ((NodeTest)in).getNodeKindMask();
if (!isSchemaAware) {
// Some node-kinds always have a typed value that's a string
if ((kinds | STRING_KINDS) == STRING_KINDS) {
return BuiltInAtomicType.STRING;
}
// Some node-kinds are always untyped atomic; some are untypedAtomic provided that the configuration
// is untyped
if ((kinds | UNTYPED_IF_UNTYPED_KINDS) == UNTYPED_IF_UNTYPED_KINDS) {
return BuiltInAtomicType.UNTYPED_ATOMIC;
}
} else {
if ((kinds | UNTYPED_KINDS) == UNTYPED_KINDS) {
return BuiltInAtomicType.UNTYPED_ATOMIC;
}
}
return in.getAtomizedItemType();
// SchemaType schemaType = ((NodeTest)in).getContentType();
// if (schemaType instanceof SimpleType) {
// return ((SimpleType)schemaType).getCommonAtomicType();
// } else if (((ComplexType)schemaType).isSimpleContent()) {