Package xbird.xquery.misc.QNameTable

Examples of xbird.xquery.misc.QNameTable.QualifiedName


        }
        namespaceContext.pushContext();
        currentToken = jj_consume_token(TagQName);
        startTag = currentToken.image;
        atts = parseDirAttributeList();
        final QualifiedName elem = QNameUtil.parse(startTag, namespaceContext, staticContext.getDefaultElementNamespace());
        ec = new ElementConstructor(elem, atts);
        switch(jj_nt.kind) {
            case EmptyTagClose:
                currentToken = jj_consume_token(EmptyTagClose);
                break;
View Full Code Here


        }
        // for dynamic namaspace declaration
        // TODO consider declared namespace is used in the attribute value.
        if(lazyAtts != null) {
            for(Pair<String, List<XQExpression>> p : lazyAtts) {
                QualifiedName att = QNameUtil.parse(p.first, namespaceContext, staticContext.getDefaultElementNamespace());
                AttributeConstructor ac = new AttributeConstructor(att, p.second);
                locate(ac);
                atts.add(ac);
            }
        }
View Full Code Here

        XQExpression nameExpr = null;
        XQExpression content = null;
        switch(jj_nt.kind) {
            case ElementQNameLbrace:
                currentToken = jj_consume_token(ElementQNameLbrace);
                QualifiedName name = QNameUtil.parse(currentToken.image.substring(8, currentToken.image.length() - 1).trim(), namespaceContext, staticContext.getDefaultElementNamespace());
                ec = new ElementConstructor(name);
                break;
            case ElementLbrace:
                currentToken = jj_consume_token(ElementLbrace);
                nameExpr = parseExpr();
View Full Code Here

        XQExpression nameExpr = null;
        XQExpression valueExpr = null;
        switch(jj_nt.kind) {
            case AttributeQNameLbrace:
                currentToken = jj_consume_token(AttributeQNameLbrace);
                QualifiedName name = QNameUtil.parse(currentToken.image.substring(10, currentToken.image.length() - 1).trim(), namespaceContext, staticContext.getDefaultElementNamespace());
                ac = new AttributeConstructor(name);
                break;
            case AttributeLbrace:
                currentToken = jj_consume_token(AttributeLbrace);
                nameExpr = parseExpr();
View Full Code Here

    }

    public QualifiedName processName(DynamicContext dynEnv) throws XQueryException {
        if(this._name == null) {
            final StaticContext sc = dynEnv.getStaticContext();
            final QualifiedName name = QNameUtil.resolveNSAttrName(_prefix, sc.getStaticalyKnownNamespaces(), sc.getDefaultElementNamespace());
            this._name = name;
        }
        return _name;
    }
View Full Code Here

        }
        final byte kind = node.nodeKind();
        if(!_kindTest.acccept(kind)) {
            return false;
        }
        final QualifiedName nodeName = _nodeName;
        if(nodeName != null) {
            final int myNameCode = nodeName.identity();
            final int nameCode = node.getNameCode();
            if(myNameCode != -1 && nameCode != -1) {
                return QNameTable.nameEquals(myNameCode, nameCode);
            } else {
                final QualifiedName name = node.nodeName();
                final String lpart = name.getLocalPart();
                final String mylpart = nodeName.getLocalPart();
                if(mylpart != lpart && ANY != mylpart) {
                    return false;
                }
                final String myprefix = nodeName.getPrefix();
                final String uri = name.getNamespaceURI();
                final String myuri = nodeName.getNamespaceURI();
                if(myuri != uri && ANY != myprefix) {
                    return false;
                }
            }
View Full Code Here

        if(qnameItor.hasNext()) {
            qnameItor.closeQuietly();
            reportError("err:XPTY0004", "Conversion of the atomized name expression to an expanded QName was not successful.");
        }
        qnameItor.closeQuietly();
        final QualifiedName namev;
        final Type t = it.getType();
        if(TypeUtil.subtypeOf(t, QNameType.QNAME)) {
            final QNameValue qname = ((AtomicValue) it).castAs(QNameType.QNAME, dynEnv);
            namev = qname.getValue();
        } else if(TypeUtil.subtypeOf(t, StringType.STRING) || t == UntypedAtomicType.UNTYPED_ATOMIC) {
View Full Code Here

     * @link http://www.w3.org/TR/xquery/#id-computedAttributes
     */
    public DMAttribute eval(Sequence<? extends Item> contextSeq, DynamicContext dynEnv)
            throws XQueryException {
        // process name
        QualifiedName instName = this.name;
        if(instName == null) { // note that should not cache it
            instName = processNameExpr(contextSeq, dynEnv);
        }
        if(XQueryConstants.XMLNS_URI.equals(instName.getNamespaceURI())
                || (instName.getNamespaceURI().length() == 0 && XQueryConstants.XMLNS.equals(instName.getLocalPart()))) {
            reportError("err:XQDY0044", "Invalid namespace format.. " + instName);
        }
        // process content
        String instValue = this._value;
        if(instValue == null) {
View Full Code Here

    @Override
    public void evalAsEvents(XQEventReceiver handler, Sequence<? extends Item> contextSeq, DynamicContext dynEnv)
            throws XQueryException {
        // process name
        QualifiedName instName = this.name;
        if(instName == null) { // note that should not cache it
            instName = processNameExpr(contextSeq, dynEnv);
        }
        if(XQueryConstants.XMLNS_URI.equals(instName.getNamespaceURI())
                || (instName.getNamespaceURI().length() == 0 && XQueryConstants.XMLNS.equals(instName.getLocalPart()))) {
            reportError("err:XQDY0044", "Invalid namespace format.. " + instName);
        }
        // process content
        String instValue = this._value;
        if(instValue == null) {
View Full Code Here

            }
            final String attname = tokens.substring(1);
            if(attname.equals("*")) {
                addComponent(null, ATTRIBUTE | WILDCARD);
            } else {
                QualifiedName qname = QNameUtil.parse(tokens, namespaces);
                addComponent(qname, ATTRIBUTE | MATCH);
            }
        } else {
            if(tokens.equals("*")) {
                addComponent(null, ELEM_WILDCARD | WILDCARD);
            } else if(tokens.equals("text()")) {
                addComponent(null, MATCH | TEXT);
            } else if(tokens.equals("node(")) {
                addComponent(null, ANYNODE);
            } else {
                QualifiedName qname = QNameUtil.parse(tokens, namespaces);
                addComponent(qname, MATCH | ELEMENT);
            }
        }
    }
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.