Package client.net.sf.saxon.ce.om

Examples of client.net.sf.saxon.ce.om.StructuredQName


        if (entry==null) {
            return null;
        }
        SystemFunction f = entry.skeleton.newInstance();
        f.setDetails(entry);
        f.setFunctionName(new StructuredQName("", NamespaceConstant.FN, name));
        f.setArguments(arguments);
        return f;
    }
View Full Code Here


            if (argument[2] instanceof StringLiteral) {
                // common case, decimal format name is supplied as a string literal

                String lexicalName = ((StringLiteral)argument[2]).getStringValue();

                StructuredQName qName;
                try {
                    qName = StructuredQName.fromLexicalQName(lexicalName, false, env.getNamespaceResolver());
                } catch (XPathException e) {
                    XPathException se = new XPathException("Invalid decimal format name. " + e.getMessage());
                    se.setErrorCode("XTDE1280");
View Full Code Here

            if (numArgs==2) {
                dfs = dfm.getDefaultDecimalFormat();
            } else {
                // the decimal-format name was given as a run-time expression
                String lexicalName = argument[2].evaluateItem(context).getStringValue();
                StructuredQName qName = null;
                try {
                    qName = StructuredQName.fromLexicalQName(lexicalName, false, nsContext);
                } catch (XPathException e) {
                    dynamicError("Invalid decimal format name. " + e.getMessage(), "XTDE1280", context);
                }
View Full Code Here

     * Get the qualified of the function being called
     * @return the qualified name
     */

    public final StructuredQName getFunctionName() {
        StructuredQName n = super.getFunctionName();
        if (n == null) {
            return function.getFunctionName();
        } else {
            return n;
        }
View Full Code Here

        setArguments(arguments);
    }

    @Override
    public StructuredQName getFunctionName() {
        return new StructuredQName(NamespaceConstant.IXSL, "", localName);
    }
View Full Code Here

            }
        }
        String s;
        if (len > 30) {
            if (valueType == ELEMENT && sb.charAt(0) == '{') {
                StructuredQName qn = StructuredQName.fromClarkName(sb.toString());
                String uri = qn.getNamespaceURI();
                if (uri.length() > 15) {
                    uri = "..." + uri.substring(uri.length()-15);
                }
                s = "{" + uri + "}" + qn.getLocalName();
            } else if (valueType == URI) {
                s = "..." + sb.toString().substring(len-30);
            } else {
                s = sb.toString().substring(0, 30) + "...";
            }
View Full Code Here

     * @param code The local part of the name of the error code
     */

    public void setErrorCode(String code) {
        if (code != null) {
            errorCode = new StructuredQName("err", NamespaceConstant.ERR, code);
        }
    }
View Full Code Here

     * @param code The local part of the name of the error code
     */

    public void maybeSetErrorCode(String code) {
        if (errorCode == null && code != null) {
            errorCode = new StructuredQName("err", NamespaceConstant.ERR, code);
        }
    }
View Full Code Here

            // If the comparand might be an empty sequence, do the base rewrite and then wrap the
            // rewritten expression EXP in "let $n := comparand if exists($n) then EXP else ()
            if (Cardinality.allowsZero(card)) {
                LetExpression let = new LetExpression();
                let.setRequiredType(SequenceType.makeSequenceType(comparand.getItemType(th), card));
                let.setVariableQName(new StructuredQName("pp", NamespaceConstant.SAXON, "pp" + let.hashCode()));
                let.setSequence(comparand);
                comparand = new LocalVariableReference(let);
                LocalVariableReference existsArg = new LocalVariableReference(let);
                Exists exists = (Exists)SystemFunction.makeSystemFunction("exists", new Expression[]{existsArg});
                Expression rewrite = tryToRewritePositionalFilterSupport(start, comparand, operator, th);
                if (rewrite == null) {
                    return null;
                }
                Expression choice = Choose.makeConditional(exists, rewrite);
                let.setAction(choice);
                return let;
            } else {
                return tryToRewritePositionalFilterSupport(start, comparand, operator, th);
            }
        } else if (filter instanceof IntegerRangeTest) {
            // rewrite SEQ[position() = N to M]
            // => let $n := N return subsequence(SEQ, $n, (M - ($n - 1))
            // (precise form is optimized for the case where $n is a literal, especially N = 1)
            Expression val = ((IntegerRangeTest)filter).getValueExpression();
            if (!(val instanceof Position)) {
                return null;
            }
            Expression min = ((IntegerRangeTest)filter).getMinValueExpression();
            Expression max = ((IntegerRangeTest)filter).getMaxValueExpression();

            if (ExpressionTool.dependsOnFocus(min)) {
                return null;
            }
            if (ExpressionTool.dependsOnFocus(max)) {
                if (max instanceof Last) {
                    return SystemFunction.makeSystemFunction("subsequence", new Expression[]{start, min});
                } else {
                    return null;
                }
            }

            LetExpression let = new LetExpression();
            let.setRequiredType(SequenceType.SINGLE_INTEGER);
            let.setVariableQName(new StructuredQName("nn", NamespaceConstant.SAXON, "nn" + let.hashCode()));
            let.setSequence(min);
            min = new LocalVariableReference(let);
            LocalVariableReference min2 = new LocalVariableReference(let);
            Expression minMinusOne = new ArithmeticExpression(
                    min2, Token.MINUS, new Literal(IntegerValue.makeIntegerValue(1)));
View Full Code Here

        }
        // If we can't determine the primitive type at compile time, we generate a run-time typeswitch

        LetExpression let = new LetExpression();
        let.setRequiredType(SequenceType.OPTIONAL_ATOMIC);
        let.setVariableQName(new StructuredQName("nn", NamespaceConstant.SAXON, "nn" + let.hashCode()));
        let.setSequence(operand);

        LocalVariableReference var = new LocalVariableReference(let);
        Expression isDouble = new InstanceOfExpression(
                var, SequenceType.makeSequenceType(BuiltInAtomicType.DOUBLE, StaticProperty.ALLOWS_ZERO_OR_ONE));
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.om.StructuredQName

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.