@Override public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().optimize(visitor, contextInfo); } return super.optimize(visitor, contextInfo); }
@Override public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().optimize(visitor, contextInfo); } return super.optimize(visitor, contextInfo); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ @Override public Expression copy(RebindingMap rebindings) { HomogeneityChecker hc = new HomogeneityChecker(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, hc); return hc; }
/** * Iterate the path-expression in a given context * * @param context the evaluation context */ /*@NotNull*/ public SequenceIterator<?> iterate(final XPathContext context) throws XPathException { // This class delivers the result of the path expression in unsorted order, // without removal of duplicates. If sorting and deduplication are needed, // this is achieved by wrapping the path expression in a DocumentSorter SequenceIterator<?> base = getBaseExpression().iterate(context); return new HomogeneityCheckerIterator(base, getLocation()); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ @Override public Expression copy(RebindingMap rebindings) { HomogeneityChecker hc = new HomogeneityChecker(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, hc); return hc; }
/** * Iterate the path-expression in a given context * * @param context the evaluation context */ /*@NotNull*/ public SequenceIterator<?> iterate(final XPathContext context) throws XPathException { // This class delivers the result of the path expression in unsorted order, // without removal of duplicates. If sorting and deduplication are needed, // this is achieved by wrapping the path expression in a DocumentSorter SequenceIterator<?> base = getBaseExpression().iterate(context); return new HomogeneityCheckerIterator(base, getLocation()); }
if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().typeCheck(visitor, contextInfo); ItemType type = getBaseExpression().getItemType(); if (type.equals(ErrorType.getInstance())) { return Literal.makeEmptySequence(); if (rel == TypeHierarchy.DISJOINT) { if (getBaseExpression() instanceof SlashExpression && ((SlashExpression) getBaseExpression()).getLeadingSteps() instanceof SlashExpression && (((SlashExpression) getBaseExpression()).getLeadingSteps().getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) { DocumentSorter ds = new DocumentSorter(((SlashExpression) getBaseExpression()).getLeadingSteps()); SlashExpression se = new SlashExpression(ds, ((SlashExpression) getBaseExpression()).getLastStep()); ExpressionTool.copyLocationInfo(this, se); return se; } else { return getBaseExpression(); Expression savedBase = getBaseExpression(); Expression parent = getParentExpression(); getOperand().detachChild();
if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().typeCheck(visitor, contextInfo); ItemType type = getBaseExpression().getItemType(); if (type.equals(ErrorType.getInstance())) { return Literal.makeEmptySequence(); if (rel == TypeHierarchy.DISJOINT) { if (getBaseExpression() instanceof SlashExpression && ((SlashExpression) getBaseExpression()).getLeadingSteps() instanceof SlashExpression && (((SlashExpression) getBaseExpression()).getLeadingSteps().getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) { DocumentSorter ds = new DocumentSorter(((SlashExpression) getBaseExpression()).getLeadingSteps()); SlashExpression se = new SlashExpression(ds, ((SlashExpression) getBaseExpression()).getLastStep()); ExpressionTool.copyLocationInfo(this, se); return se; } else { return getBaseExpression(); Expression savedBase = getBaseExpression(); Expression parent = getParentExpression(); getOperand().detachChild();