@Override public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { Expression e2 = super.typeCheck(visitor, contextInfo); if (e2 != this) { return e2; } TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); if (th.relationship(getBaseExpression().getItemType(), AnyNodeTest.getInstance()) == TypeHierarchy.DISJOINT) { return getBaseExpression(); } RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.MISC, "document-order sorter", 0); Expression operand = visitor.getConfiguration().getTypeChecker(false).staticTypeCheck( getBaseExpression(), SequenceType.NODE_SEQUENCE, role, visitor); setBaseExpression(operand); return this; }
@Override public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { Expression e2 = super.typeCheck(visitor, contextInfo); if (e2 != this) { return e2; } TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); if (th.relationship(getBaseExpression().getItemType(), AnyNodeTest.getInstance()) == TypeHierarchy.DISJOINT) { return getBaseExpression(); } RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.MISC, "document-order sorter", 0); Expression operand = visitor.getConfiguration().getTypeChecker(false).staticTypeCheck( getBaseExpression(), SequenceType.NODE_SEQUENCE, role, visitor); setBaseExpression(operand); return this; }