Package net.sf.saxon.om

Examples of net.sf.saxon.om.StructuredQName


     * 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


    public SourceLocator getLocator() {
        return this;
    }

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

            } catch (XPathException err) {
                compileError(err.getMessage(), err.getErrorCodeQName());
            }
        } else {
            try {
                StructuredQName formatName = makeQName(name);
                try {
                    dfm.setNamedDecimalFormat(formatName, d, getPrecedence());
                } catch (XPathException err) {
                    compileError(err.getMessage(), err.getErrorCodeQName());
                }
View Full Code Here

            UserFunctionCall ufc = (UserFunctionCall)unboundFunctionCalls.get(i);
            QueryModule importingModule = (QueryModule)correspondingStaticContext.get(i);
            correspondingStaticContext.set(i, null);    // for garbage collection purposes
            // The original UserFunctionCall is effectively a dummy: we weren't able to find a function
            // definition at the time. So we try again.
            final StructuredQName q = ufc.getFunctionName();
            final int arity = ufc.getNumberOfArguments();

            XQueryFunction fd = lib.getDeclaration(q, ufc.getArguments());
            if (fd != null) {
                fd.registerReference(ufc);
                ufc.setStaticType(fd.getResultType());
                ufc.setConfirmed(true);
                // Check that the result type and all the argument types are in the static context of the
                // calling module
                importingModule.checkImportedFunctionSignature(fd);
            } else {
                String msg = "Cannot find a matching " + arity +
                        "-argument function named " + q.getClarkName() + "()";
                if (!config.isAllowExternalFunctions()) {
                    msg += ". Note: external function calls have been disabled";
                }
                XPathException err = new XPathException(msg, ufc);
                err.setErrorCode("XPST0017");
View Full Code Here

                }
            }
            QName[] qnames = new QName[params.size()];
            int q=0;
            for (Iterator it=params.iterator(); it.hasNext();) {
                StructuredQName name = (StructuredQName)it.next();
                qnames[q++] = new QName(name.getNamespaceURI(), name.getLocalName(), name.getPrefix());
            }
            return qnames;
        }
    }
View Full Code Here

    }

    public XQSequenceType getStaticVariableType(QName name) throws XQException {
        checkNotClosed();
        checkNotNull(name);
        StructuredQName qn = new StructuredQName(
                name.getPrefix(), name.getNamespaceURI(), name.getLocalPart());
        HashMap vars = expression.getExecutable().getCompiledGlobalVariables();
        GlobalVariable var = (vars == null ? null : (GlobalVariable)vars.get(qn));
        if (var == null) {
            throw new XQException("Variable " + name + " is not declared");
View Full Code Here

        return new SaxonXQSequenceType(var.getRequiredType(), connection.getConfiguration());
    }


    protected boolean externalVariableExists(QName name) {
        StructuredQName qn = new StructuredQName(
                name.getPrefix(), name.getNamespaceURI(), name.getLocalPart());
        HashMap vars = expression.getExecutable().getCompiledGlobalVariables();
        GlobalVariable var = (vars == null ? null : (GlobalVariable)vars.get(qn));
        return var != null && var instanceof GlobalParam;
    }
View Full Code Here

    public QNameValue(NamePool namePool, int nameCode) {
        String prefix = namePool.getPrefix(nameCode);
        String uri = namePool.getURI(nameCode);
        String localPart = namePool.getLocalName(nameCode);
        qName = new StructuredQName(prefix, uri, localPart);
        typeLabel = BuiltInAtomicType.QNAME;
    }
View Full Code Here

        if (checker != null && uri == null && prefix.length() != 0) {
            XPathException err = new XPathException("QName has null namespace but non-empty prefix");
            err.setErrorCode("FOCA0002");
            throw err;
        }
        qName = new StructuredQName(prefix, uri, localName);
        typeLabel = type;
    }
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

TOP

Related Classes of net.sf.saxon.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.