@Override public Expression makeFunctionCall(Expression[] arguments) { return FirstItemExpression.makeFirstItemExpression(arguments[0]); }
@Override public Expression makeFunctionCall(Expression[] arguments) { return FirstItemExpression.makeFirstItemExpression(arguments[0]); }
public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { getOperand().optimize(visitor, contextInfo); if (Literal.isConstantOne(getSubscript())) { return FirstItemExpression.makeFirstItemExpression(getBaseExpression()); } return this; }
public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { getOperand().optimize(visitor, contextInfo); if (Literal.isConstantOne(getSubscript())) { return FirstItemExpression.makeFirstItemExpression(getBaseExpression()); } return this; }
public Expression processValueOf(Expression select, Configuration config) { TypeHierarchy th = config.getTypeHierarchy(); if (!select.getItemType().isPlainType()) { select = Atomizer.makeAtomizer(select); } if (Cardinality.allowsMany(select.getCardinality())) { select = FirstItemExpression.makeFirstItemExpression(select); } if (!th.isSubType(select.getItemType(), BuiltInAtomicType.STRING)) { select = new AtomicSequenceConverter(select, BuiltInAtomicType.STRING); ((AtomicSequenceConverter) select).allocateConverterStatically(config, false); } return select; }
public Expression processValueOf(Expression select, Configuration config) { TypeHierarchy th = config.getTypeHierarchy(); if (!select.getItemType().isPlainType()) { select = Atomizer.makeAtomizer(select, null); } if (Cardinality.allowsMany(select.getCardinality())) { select = FirstItemExpression.makeFirstItemExpression(select); } if (!th.isSubType(select.getItemType(), BuiltInAtomicType.STRING)) { select = new AtomicSequenceConverter(select, BuiltInAtomicType.STRING); ((AtomicSequenceConverter) select).allocateConverterStatically(config, false); } return select; }
/** * Make an expression that extracts the first item of a sequence, after atomization */ /*@NotNull*/ public static Expression makeFirstItem(Expression exp, StaticContext env) { if (Literal.isEmptySequence(exp)) { return exp; } final TypeHierarchy th = env.getConfiguration().getTypeHierarchy(); if (!exp.getItemType().isPlainType()) { exp = Atomizer.makeAtomizer(exp, null); } if (Cardinality.allowsMany(exp.getCardinality())) { exp = FirstItemExpression.makeFirstItemExpression(exp); } if (!th.isSubType(exp.getItemType(), BuiltInAtomicType.STRING)) { exp = new AtomicSequenceConverter(exp, BuiltInAtomicType.STRING); ((AtomicSequenceConverter) exp).allocateConverterStatically(env.getConfiguration(), false); } return exp; }
/** * Make an expression that extracts the first item of a sequence, after atomization */ /*@NotNull*/ public static Expression makeFirstItem(Expression exp, StaticContext env) { if (Literal.isEmptySequence(exp)) { return exp; } final TypeHierarchy th = env.getConfiguration().getTypeHierarchy(); if (!exp.getItemType().isPlainType()) { exp = Atomizer.makeAtomizer(exp); } if (Cardinality.allowsMany(exp.getCardinality())) { exp = FirstItemExpression.makeFirstItemExpression(exp); } if (!th.isSubType(exp.getItemType(), BuiltInAtomicType.STRING)) { exp = new AtomicSequenceConverter(exp, BuiltInAtomicType.STRING); ((AtomicSequenceConverter) exp).allocateConverterStatically(env.getConfiguration(), false); } return exp; }
Expression cexp = FirstItemExpression.makeFirstItemExpression(supplied); cexp.adoptChildExpression(supplied); supplied = cexp;
Expression cexp = FirstItemExpression.makeFirstItemExpression(supplied); cexp.adoptChildExpression(supplied); supplied = cexp;
Expression fie = FirstItemExpression.makeFirstItemExpression(getBase()); ExpressionTool.copyLocationInfo(this, fie); return fie;
Expression fie = FirstItemExpression.makeFirstItemExpression(getBase()); ExpressionTool.copyLocationInfo(this, fie); return fie;
Expression first = FirstItemExpression.makeFirstItemExpression(this); return tc.staticTypeCheck(first, req, role, visitor);
Expression first = FirstItemExpression.makeFirstItemExpression(this); return tc.staticTypeCheck(first, req, role, visitor);
sortKey = FirstItemExpression.makeFirstItemExpression(sortKey); } else { RoleDiagnostic role =
sortKey = FirstItemExpression.makeFirstItemExpression(sortKey); } else { RoleDiagnostic role =
sortKey = sortKey.typeCheck(visitor, cit); if (sk.isBackwardsCompatible()) { sortKey = FirstItemExpression.makeFirstItemExpression(sortKey); } else { RoleDiagnostic role =
sortKey = sortKey.typeCheck(visitor, cit); if (sk.isBackwardsCompatible()) { sortKey = FirstItemExpression.makeFirstItemExpression(sortKey); } else { RoleDiagnostic role =
TypeHierarchy th = config.getTypeHierarchy(); if (Cardinality.allowsMany(operand.getCardinality())) { Expression fie = FirstItemExpression.makeFirstItemExpression(operand); ExpressionTool.copyLocationInfo(this, fie); operand = fie;
TypeHierarchy th = config.getTypeHierarchy(); if (Cardinality.allowsMany(operand.getCardinality())) { Expression fie = FirstItemExpression.makeFirstItemExpression(operand); ExpressionTool.copyLocationInfo(this, fie); operand = fie;