/** * Get the static type of the expression as a UType, following precisely the type * inference rules defined in the XSLT 3.0 specification. * * @param contextItemType the static type of the context item * @return the static item type of the expression according to the XSLT 3.0 defined rules */ @Override public UType getStaticUType(UType contextItemType) { return getBaseExpression().getStaticUType(contextItemType); }
/** * Determine the data type of the expression, if possible. The default * implementation for unary expressions returns the item type of the operand * * @return the item type of the items in the result sequence, insofar as this * is known statically. */ /*@NotNull*/ @Override public ItemType getItemType() { return getBaseExpression().getItemType(); }
/** * Get the static type of the expression as a UType, following precisely the type * inference rules defined in the XSLT 3.0 specification. * * @param contextItemType the static type of the context item * @return the static item type of the expression according to the XSLT 3.0 defined rules */ @Override public UType getStaticUType(UType contextItemType) { return getBaseExpression().getStaticUType(contextItemType); }
/** * Determine the data type of the expression, if possible. The default * implementation for unary expressions returns the item type of the operand * * @return the item type of the items in the result sequence, insofar as this * is known statically. */ /*@NotNull*/ @Override public ItemType getItemType() { return getBaseExpression().getItemType(); }
@Override public int computeCardinality() { return getBaseExpression().getCardinality() | StaticProperty.ALLOWS_ZERO; }
@Override public int computeCardinality() { return getBaseExpression().getCardinality() | StaticProperty.ALLOWS_ZERO; }
@Override public Expression simplify() throws XPathException { Expression operand = getBaseExpression(); if (operand instanceof Literal && ((Literal) operand).getValue() instanceof AtomicValue) { return operand; } else { return super.simplify(); } }
@Override public Expression simplify() throws XPathException { Expression operand = getBaseExpression(); if (operand instanceof Literal && ((Literal) operand).getValue() instanceof AtomicValue) { return operand; } else { return super.simplify(); } }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws net.sf.saxon.trans.XPathException * if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ @Override public SequenceIterator<?> iterate(XPathContext context) throws XPathException { return new AdjacentTextNodeMergingIterator(getBaseExpression().iterate(context)); }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws net.sf.saxon.trans.XPathException * if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ @Override public SequenceIterator<?> iterate(XPathContext context) throws XPathException { return new AdjacentTextNodeMergingIterator(getBaseExpression().iterate(context)); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { AdjacentTextNodeMerger a2 = new AdjacentTextNodeMerger(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, a2); return a2; }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { AdjacentTextNodeMerger a2 = new AdjacentTextNodeMerger(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, a2); return a2; }
if (th.relationship(getBaseExpression().getItemType(), NodeKindTest.TEXT) == TypeHierarchy.DISJOINT) { Expression base = getBaseExpression(); base.setParentExpression(getParentExpression()); return base; if (!Cardinality.allowsMany(getBaseExpression().getCardinality())) { Expression base = getBaseExpression(); base.setParentExpression(getParentExpression()); return base; if (getBaseExpression() instanceof Choose) { Choose choose = (Choose) getBaseExpression(); for (int i = 0; i < choose.size(); i++) { AdjacentTextNodeMerger atm2 = new AdjacentTextNodeMerger(choose.getAction(i)); if (getBaseExpression() instanceof Block) { Block block = (Block) getBaseExpression(); Operand[] actions = block.getOperanda(); boolean prevtext = false;
if (th.relationship(getBaseExpression().getItemType(), NodeKindTest.TEXT) == TypeHierarchy.DISJOINT) { Expression base = getBaseExpression(); base.setParentExpression(getParentExpression()); return base; if (!Cardinality.allowsMany(getBaseExpression().getCardinality())) { Expression base = getBaseExpression(); base.setParentExpression(getParentExpression()); return base; if (getBaseExpression() instanceof Choose) { Choose choose = (Choose) getBaseExpression(); for (int i = 0; i < choose.size(); i++) { AdjacentTextNodeMerger atm2 = new AdjacentTextNodeMerger(choose.getAction(i)); if (getBaseExpression() instanceof Block) { Block block = (Block) getBaseExpression(); Operand[] actions = block.getOperanda(); boolean prevtext = false;
Receiver out = context.getReceiver(); FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C256); SequenceIterator iter = getBaseExpression().iterate(context); boolean prevText = false; Item item;
Receiver out = context.getReceiver(); FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.C256); SequenceIterator iter = getBaseExpression().iterate(context); boolean prevText = false; Item item;