Package client.net.sf.saxon.ce.expr

Examples of client.net.sf.saxon.ce.expr.Expression


     */

    public Expression bind(StructuredQName functionName, Expression[] staticArgs, StaticContext env, Container container)
            throws XPathException {
        for (FunctionLibrary lib : libraryList) {
            Expression func = lib.bind(functionName, staticArgs, env, container);
            if (func != null) {
                return func;
            }
        }
        return null;
View Full Code Here


                err.setErrorCode("XPST0017");
                err.setIsStaticError(true);
                throw err;
            }

            Expression cast = new CastExpression(arguments[0], type, true);
            cast.setContainer(container);
            return cast;
        }
        return null;
    }
View Full Code Here

        // can be matched by hashing on the element name, so we do it always
        if (pattern instanceof UnionPattern) {
            UnionPattern up = (UnionPattern)pattern;
            Pattern p1 = up.getLHS();
            Pattern p2 = up.getRHS();
            Expression currentSetter = up.getVariableBindingExpression();
            if (currentSetter != null) {
                p1.setVariableBindingExpression(currentSetter);
                p2.setVariableBindingExpression(currentSetter);
            }
            setTemplateRule(p1, eh, mode, module, priority, ixslPreventDefault, ixslEventProperty);
View Full Code Here

            if (curr == null) {
                break;
            }
            if (curr instanceof XSLWhen) {
                conditions[w] = ((XSLWhen)curr).getCondition();
                Expression b = ((XSLWhen)curr).compileSequenceConstructor(
                        exec, decl, curr.iterateAxis(Axis.CHILD));
                if (b == null) {
                    b = Literal.makeEmptySequence();
                }
                try {
                    b = makeExpressionVisitor().simplify(b);
                    if (LogConfiguration.loggingIsEnabled() && LogController.traceIsEnabled()) {
                      String test = XSLIf.getTestAttribute((XSLWhen)curr);
                      conditionTests[w] = test;
                    }
                    actions[w] = b;
                } catch (XPathException e) {
                    compileError(e);
                }

                // Optimize for constant conditions (true or false)
                if (conditions[w] instanceof Literal && ((Literal)conditions[w]).getValue() instanceof BooleanValue) {
                    if (((BooleanValue)((Literal)conditions[w]).getValue()).getBooleanValue()) {
                        // constant true: truncate the tests here
                        entries = w+1;
                        break;
                    } else {
                        // constant false: omit this test
                        w--;
                        entries--;
                    }
                }
                w++;
            } else if (curr instanceof XSLOtherwise) {
                conditions[w] = Literal.makeLiteral(BooleanValue.TRUE);
                Expression b = ((XSLOtherwise)curr).compileSequenceConstructor(
                        exec, decl, curr.iterateAxis(Axis.CHILD));
                if (b == null) {
                    b = Literal.makeEmptySequence();
                }
                try {
View Full Code Here

    public Expression compile(Executable exec, Declaration decl) throws XPathException {
        SortKeyDefinition[] sortKeys = makeSortKeys(decl);
        if (select != null) {
            return new SortExpression(select, sortKeys);
        } else {
            Expression body = compileSequenceConstructor(exec, decl, iterateAxis(Axis.CHILD));
            if (body == null) {
                body = Literal.makeEmptySequence();
            }
            try {
                return new SortExpression(makeExpressionVisitor().simplify(body), sortKeys);
View Full Code Here

            } else if (f.equals(StandardNames.USE_CHARACTER_MAPS)) {
                useCharacterMapsAtt = Whitespace.trim(atts.getValue(a));
            } else if (fans.contains(f) || f.startsWith("{")) {
                // this is a serialization attribute
                String val = Whitespace.trim(atts.getValue(a));
                Expression exp = makeAttributeValueTemplate(val);
                //serializationAttributes.put(nc&0xfffff, exp);
          } else {
            checkUnknownAttribute(nc);
          }
        }
View Full Code Here

    public Expression compile(Executable exec, Declaration decl) throws XPathException {

        ResultDocument inst = new ResultDocument(href, methodExpression, getBaseURI(), this);

        Expression b = compileSequenceConstructor(exec, decl, iterateAxis(Axis.CHILD));
        if (b == null) {
            b = new Literal(EmptySequence.getInstance());
        }
        inst.setContentExpression(b);
        return inst;
View Full Code Here

    }

    public Expression compile(Executable exec, Declaration decl) throws XPathException {

        DocumentInstr inst = new DocumentInstr(false, null, getBaseURI());
        Expression b = compileSequenceConstructor(exec, decl, iterateAxis(Axis.CHILD));
        if (b == null) {
            b = Literal.makeEmptySequence();
        }
        inst.setContentExpression(b);
        return inst;
View Full Code Here

*/
public class IXSLSetAttribute extends XSLAttribute {

    @Override
    public Expression compile(Executable exec, Declaration decl) throws XPathException {
        Expression constructor = super.compile(exec, decl);
        return new SetAttribute((AttributeCreator)constructor);
    }
View Full Code Here

        select = typeCheck(select);
    }

    public Expression compile(Executable exec, Declaration decl) throws XPathException {
        SortKeyDefinition[] sortKeys = makeSortKeys(decl);
        Expression sortedSequence = select;
        if (sortKeys != null) {
            sortedSequence = new SortExpression(select, sortKeys);
        }

        Expression block = compileSequenceConstructor(exec, decl, iterateAxis(Axis.CHILD));
        if (block == null) {
            // body of for-each is empty: it's a no-op.
            return Literal.makeEmptySequence();
        }
        try {
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.expr.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.