/** * Default constructor used by subclasses */ public SimpleNodeConstructor() { Expression select = Literal.makeEmptySequence(); selectOp = new Operand(this, select, OperandRole.SINGLE_ATOMIC); }
/** * Default constructor used by subclasses */ public SimpleNodeConstructor() { Expression select = Literal.makeEmptySequence(); selectOp = new Operand(this, select, OperandRole.SINGLE_ATOMIC); }
/** * Given a list of UseAttributeSet expressions, combine them into a single expression * * @param targets the list of expressions * @return the combined expression */ public static Expression makeCompositeExpression(List<UseAttributeSet> targets) { if (targets.size() == 0) { return Literal.makeEmptySequence(); } else if (targets.size() == 1) { return targets.get(0); } else { return new Block(targets.toArray(new Expression[0])); } }
public Expression compile(Executable exec) throws XPathException { Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (content == null) { content = Literal.makeEmptySequence(); } Doctype inst = new Doctype(content); return inst; }
public Expression compile(Executable exec) throws XPathException { Expression action = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (action == null) { action = Literal.makeEmptySequence(); } While w = new While(test, action); return w; }
public Expression compile(Executable exec) throws XPathException { Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (content == null) { content = Literal.makeEmptySequence(); } Doctype inst = new Doctype(content); return inst; }
public Expression compile(Executable exec) throws XPathException { Expression action = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (action == null) { action = Literal.makeEmptySequence(); } While w = new While(test, action); return w; }
/** * Compile time evaluation * @param visitor an expression visitor */ public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException { String baseURI = visitor.getStaticContext().getBaseURI(); if (baseURI == null) { return Literal.makeEmptySequence(); } return Literal.makeLiteral(new AnyURIValue(baseURI)); }
/** * Compile time evaluation * @param visitor an expression visitor */ public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException { String baseURI = visitor.getStaticContext().getBaseURI(); if (baseURI == null) { return Literal.makeEmptySequence(); } return Literal.makeLiteral(new AnyURIValue(baseURI)); }
/** * Compile time evaluation * @param visitor an expression visitor */ public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException { String baseURI = visitor.getStaticContext().getBaseURI(); if (baseURI == null) { return Literal.makeEmptySequence(); } return Literal.makeLiteral(new AnyURIValue(baseURI)); }
public Expression parseParenthesizedExpression() throws XPathException { nextToken(); if (t.currentToken == Token.RPAR) { nextToken(); return Literal.makeEmptySequence(); } Expression seq = parseExpression(); expect(Token.RPAR); nextToken(); return seq; }
public Expression parseParenthesizedExpression() throws XPathException { nextToken(); if (t.currentToken == Token.RPAR) { nextToken(); return Literal.makeEmptySequence(); } Expression seq = parseExpression(); expect(Token.RPAR); nextToken(); return seq; }
public Accumulator() { preDescentRules = new SimpleMode(new StructuredQName("saxon", NamespaceConstant.SAXON, "preDescent")); postDescentRules = new SimpleMode(new StructuredQName("saxon", NamespaceConstant.SAXON, "postDescent")); // The "body" of an accumulator is an artificial expression that contains all the constituent expressions, for ease of management. body = Literal.makeEmptySequence(); }
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null); inst.setValidationAction(validationAction, schemaType); Expression b = compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); inst.setLocation(allocateLocation()); return inst; }
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null); inst.setValidationAction(validationAction, schemaType); Expression b = compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); inst.setLocation(allocateLocation()); return inst; }
public Accumulator() { preDescentRules = new SimpleMode(new StructuredQName("saxon", NamespaceConstant.SAXON, "preDescent")); postDescentRules = new SimpleMode(new StructuredQName("saxon", NamespaceConstant.SAXON, "postDescent")); // The "body" of an accumulator is an artificial expression that contains all the constituent expressions, for ease of management. body = Literal.makeEmptySequence(); }
public Expression compile(Executable exec) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null, getBaseURI()); inst.setValidationMode(validationAction); inst.setSchemaType(schemaType); Expression b = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); return inst; }
public Expression compile(Executable exec) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null, getBaseURI()); inst.setValidationAction(validationAction); inst.setSchemaType(schemaType); Expression b = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); return inst; }
private Expression parseCommentConstructor(int offset) throws XPathException { nextToken(); Expression value; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { value = Literal.makeEmptySequence(); } else { value = parseExpression(); } expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); Comment com = new Comment(); makeSimpleContent(value, com, offset); return makeTracer(offset, com, StandardNames.XSL_COMMENT, null); }
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { selectOp.typeCheck(visitor, contextInfo); ItemType selectType = getSelect().getItemType(); if (selectType == ErrorType.getInstance()) { return Literal.makeEmptySequence(); } ContextItemStaticInfo cit = visitor.getConfiguration().makeContextItemStaticInfo(getSelect().getItemType(), false); cit.setContextSettingExpression(getSelect()); actionOp.typeCheck(visitor, cit); if (!Cardinality.allowsMany(getSelect().getCardinality())) { actionOp.setOperandRole(actionOp.getOperandRole().modifyProperty(OperandRole.SINGLETON, true)); } return this; }