Package xbird.xquery.misc.QNameTable

Examples of xbird.xquery.misc.QNameTable.QualifiedName


                // that matches this prefix, then an error is raised [err:FONS0004].
                throw new DynamicError("err:FONS0004", "Namespace for the prefix `" + qnameStr
                        + "` not found");
            }
        }
        final QualifiedName resolved;
        try {
            resolved = QNameUtil.parse(qnameStr, nsuri);
        } catch (IllegalArgumentException e) {
            // If $qname does not have the correct lexical form for xs:QName an error
            // is raised [err:FOCA0002].
View Full Code Here


        s[1] = new FunctionSignature(getName(), new Type[] { TypeRegistry.safeGet("node()?") });
        return s;
    }

    public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv) throws XQueryException {
        final QualifiedName nodeName;
        if (argv == null) {
            // If the argument is omitted, it defaults to the context node.
            Item contextItem = dynEnv.contextItem();
            if (contextItem == null) {
                throw new DynamicError("err:XPDY0002", "ContextItem is not set");
View Full Code Here

        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        QNameValue arg = (QNameValue) firstItem;
        QualifiedName qname = arg.getValue();
        String nsuri = qname.getNamespaceURI();
        return AnyURIValue.valueOf(nsuri);
    }
View Full Code Here

        }
        final Item first = itemItor.next();
        assert (!itemItor.hasNext()) : it;
        itemItor.closeQuietly();
        final XQNode node = (XQNode) first;
        final QualifiedName nodename = node.nodeName();
        if(nodename != null) {
            return new QNameValue(nodename);
        }
        return ValueSequence.EMPTY_SEQUENCE;
    }
View Full Code Here

        return s;
    }

    public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
            throws XQueryException {
        final QualifiedName errorName;
        String desc = null;
        String[] errObjects = null;
        if(argv == null) {
            errorName = DEFAULT_ERR_NAME;
        } else {
View Full Code Here

            }
            paramUri = XMLUtils.NULL_NS_URI;
        } else {
            paramUri = ((XString) firstItem).getValue();
        }
        final QualifiedName ret;
        try {
            ret = QNameUtil.parse(qname, paramUri);
        } catch (Throwable e) {
            throw new DynamicError("err:FOCA0002", "Incorrect lexical form for xs:QName: " + qname);
        }
View Full Code Here

    @Override
    public XQExpression visit(AttributeConstructor constructor, XQueryContext ctxt)
            throws XQueryException {
        header("AttributeConstructor");
        final QualifiedName name = constructor.getName();
        if(name != null) {
            attrFeed("name", name.toString());
        } else {
            attrFeed("name");
            indentln();
            XQExpression nameExpr = constructor.getNameExpr();
            nameExpr.visit(this, ctxt);
View Full Code Here

        return expr;
    }

    @Override
    public XQExpression visit(FunctionCall call, XQueryContext ctxt) throws XQueryException {
        QualifiedName fname = call.getFuncName();
        final String prefix = fname.getPrefix();
        if(prefix != null && prefix.length() > 0) {
            buf.append(prefix);
            buf.append(':');
        }
        buf.append(fname.getLocalPart());
        buf.append('(');
        List params = call.getParams();
        for(int i = 0; i < params.size(); i++) {
            if(i != 0) {
                buf.append(", ");
View Full Code Here

    }

    @Override
    public XQExpression visit(UserFunction function, XQueryContext ctxt) throws XQueryException {
        buf.append("declare function ");
        final QualifiedName funcName = function.getName();
        final String prefix = funcName.getPrefix();
        if(prefix != null && prefix.length() > 0) {
            buf.append(prefix);
            buf.append(':');
        }
        buf.append(funcName.getLocalPart());
        buf.append('(');
        List params = function.getParameters();
        for(int i = 0; i < params.size(); i++) {
            if(i != 0) {
                buf.append(", ");
View Full Code Here

                    String namespaceURI = readString(input);
                    handler.evEndElement(prefix, localName, namespaceURI);
                    break;
                }
                case XQEventEncoder.EV_ATTR: {
                    QualifiedName qname = QualifiedName.readFrom(input);
                    String value = readString(input);
                    handler.evAttribute(qname, value);
                    break;
                }
                case XQEventEncoder.EV_NAMESPACE: {
View Full Code Here

TOP

Related Classes of xbird.xquery.misc.QNameTable.QualifiedName

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.