Package net.sf.saxon.functions

Examples of net.sf.saxon.functions.SystemFunction


                type.equals(BuiltInAtomicType.UNTYPED_ATOMIC) &&
                requiredItemType == BuiltInAtomicType.STRING &&
                ((Atomizer)operand).getBaseExpression().getItemType(th) instanceof NodeTest) {
            Expression nodeExp = ((Atomizer)operand).getBaseExpression();
            if (Cardinality.allowsMany(nodeExp.getCardinality())) {
                SystemFunction fn = (SystemFunction)SystemFunction.makeSystemFunction(
                        "string", new Expression[]{new ContextItemExpression()});
                fn.setContainer(getContainer());
                AtomicMappingExpression map = new AtomicMappingExpression(nodeExp, fn);
                map.setContainer(getContainer());
                return map;
            } else {
                SystemFunction fn = (SystemFunction)SystemFunction.makeSystemFunction(
                        "string", new Expression[]{nodeExp});
                fn.setContainer(getContainer());
                return fn;
            }
        }
        if (type.equals(BuiltInAtomicType.ANY_ATOMIC) || type instanceof AnyItemType ||
                type.equals(BuiltInAtomicType.UNTYPED_ATOMIC)) {
View Full Code Here


            StandardFunction.Entry entry = StandardFunction.getFunction(local);
            if (entry == null) {
                throw new StaticError("Unknown system function " + local + "()");
            }
            Class functionClass = entry.implementationClass;
            SystemFunction f;
            try {
                f = (SystemFunction)functionClass.newInstance();
            } catch (Exception err) {
                throw new AssertionError("Failed to load system function: " + err.getMessage());
            }
            f.setDetails(entry);
            f.setFunctionNameCode(nameCode);
            f.setArguments(staticArgs);
            checkArgumentCount(staticArgs.length, entry.minArguments, entry.maxArguments, local);
            if (f instanceof XSLTFunction && !allowXSLTFunctions) {
                throw new StaticError("Cannot use the " + local + "() function in a non-XSLT context");
            }
            return f;
View Full Code Here

            StandardFunction.Entry entry = (StandardFunction.Entry)functionTable.get(local);
            if (entry == null) {
                return null;
            }
            Class functionClass = entry.implementationClass;
            SystemFunction f;
            try {
                f = (SystemFunction)functionClass.newInstance();
            } catch (Exception err) {
                throw new AssertionError("Failed to load Saxon extension function: " + err.getMessage());
            }
            f.setDetails(entry);
            f.setFunctionNameCode(nameCode);
            f.setArguments(staticArgs);
            checkArgumentCount(staticArgs.length, entry.minArguments, entry.maxArguments, local);
            return f;
        } else {
            return null;
        }
View Full Code Here

TOP

Related Classes of net.sf.saxon.functions.SystemFunction

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.