/** * Check to ensure that this expression does not contain any inappropriate updating * subexpressions. This check is overridden for those expressions that permit updating * subexpressions. * * @throws net.sf.saxon.trans.XPathException if the expression has a non-permitted updateing * subexpression */ public void checkForUpdatingSubexpressions() throws XPathException { sequence.checkForUpdatingSubexpressions(); if (sequence.isUpdatingExpression()) { XPathException err = new XPathException( "An updating expression cannot be used to initialize a variable", "XUST0001"); err.setLocator(sequence); throw err; } action.checkForUpdatingSubexpressions(); }
/** * If the variable is bound to an integer, get the minimum and maximum possible values. Return * null if unknown or not applicable */ public IntegerValue[] getIntegerBoundsForVariable() { return sequence.getIntegerBounds(); }
/** * Add a representation of this expression to a PathMap. The PathMap captures a map of the nodes * visited by an expression in a source tree. * * <p> * * <p>The default implementation of this method assumes that an expression does no navigation * other than the navigation done by evaluating its subexpressions, and that the subexpressions * are evaluated in the same context as the containing expression. The method must be overridden * for any expression where these assumptions do not hold. For example, implementations exist for * AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for * the doc(), document(), and collection() functions because they create a new navigation root. * Implementations also exist for PathExpression and FilterExpression because they have * subexpressions that are evaluated in a different context from the calling expression. * * @param pathMap the PathMap to which the expression should be added * @param pathMapNodeSet the PathMapNodeSet to which the paths embodied in this expression should * be added * @return the pathMapNodeSet representing the points in the source document that are both * reachable by this expression, and that represent possible results of this expression. For * an expression that does navigation, it represents the end of the arc in the path map that * describes the navigation route. For other expressions, it is the same as the input * pathMapNode. */ public PathMap.PathMapNodeSet addToPathMap( PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet) { PathMap.PathMapNodeSet varPath = sequence.addToPathMap(pathMap, pathMapNodeSet); pathMap.registerPathForVariable(this, varPath); return action.addToPathMap(pathMap, pathMapNodeSet); }
/** * Suppress validation on contained element constructors, on the grounds that the parent element * is already performing validation. The default implementation does nothing. */ public void suppressValidation(int validationMode) { action.suppressValidation(validationMode); }
/** * Determine whether this is an updating expression as defined in the XQuery update specification * * @return true if this is an updating expression */ public boolean isUpdatingExpression() { return action.isUpdatingExpression(); }