Package xbird.xquery.misc.QNameTable

Examples of xbird.xquery.misc.QNameTable.QualifiedName


                    }
                }
                receiver.evEndDocument();
                break;
            case NodeKind.ELEMENT:
                final QualifiedName qname = doctbl.getName(nodeid);
                receiver.evStartElement(nodeid, qname);
                // namespace decl
                final int nsdeclCnt = doctbl.getNamespaceCountAt(nodeid);
                for(int i = 0; i < nsdeclCnt; i++) {
                    final long nsid = doctbl.getNamespaceDecl(nodeid, i);
                    final QualifiedName nsName = doctbl.getAttributeName(nsid);
                    final String uri = doctbl.getText(nsid);
                    receiver.evNamespace(nsid, nsName, uri);
                }
                // attribute
                final int attrCnt = doctbl.getAttributeCountAt(nodeid);
                for(int i = 0; i < attrCnt; i++) {
                    final long attid = doctbl.getAttribute(nodeid, i);
                    final QualifiedName attName = doctbl.getAttributeName(attid);
                    final String attValue = doctbl.getText(attid);
                    receiver.evAttribute(attid, attName, attValue);
                }
                final long elemFirstChild = doctbl.firstChild(nodeid);
                if(elemFirstChild != -1L) {
                    export(elemFirstChild, receiver);
                    long nextSib = doctbl.nextSibling(elemFirstChild);
                    while(nextSib != 0L) {
                        export(nextSib, receiver);
                        nextSib = doctbl.nextSibling(nextSib);
                    }
                }
                receiver.evEndElement(nodeid, qname);
                break;
            case NodeKind.ATTRIBUTE:
                receiver.evAttribute(nodeid, doctbl.getAttributeName(nodeid), doctbl.getText(nodeid));
                break;
            case NodeKind.NAMESPACE:
                receiver.evNamespace(nodeid, doctbl.getAttributeName(nodeid), doctbl.getText(nodeid));
                break;
            case NodeKind.TEXT:
                receiver.evText(nodeid, doctbl.getText(nodeid));
                break;
            case NodeKind.COMMENT:
                receiver.evComment(nodeid, doctbl.getText(nodeid));
                break;
            case NodeKind.PROCESSING_INSTRUCTION:
                final QualifiedName pi = doctbl.getName(nodeid);
                receiver.evProcessingInstruction(nodeid, pi.getLocalPart(), pi.getNamespaceURI());
                break;
            default:
                throw new IllegalStateException("Invalid node kind '"
                        + NodeKind.resolveName(doctbl.getNodeKindAt(nodeid)) + "' for node#"
                        + nodeid);
View Full Code Here


            int attcnt = store.getAttributeCountAt(_id);
            for(int i = 0; i < attcnt; i++) {
                long attid = store.getAttribute(_id, i);
                assert (attid != -1);
                assert (store.getNodeKindAt(attid) != NodeKind.ATTRIBUTE);
                QualifiedName qname = store.getAttributeName(attid);
                String attUri = qname.getNamespaceURI();
                String attName = qname.getLocalPart();
                if(nsuri == null || nsuri.equals(attUri)) {
                    if(attname.equals(attName)) {
                        final DocumentTableModel model = getDataModel();
                        return new DTMAttribute(model, attid);
                    }
View Full Code Here

            long attid;
            for(int i = 0; (attid = getAttribute(i)) != -1; i++) {
                assert (attid != -1);
                byte attkind = store.getNodeKindAt(attid);
                if(attkind == NodeKind.ATTRIBUTE) {
                    QualifiedName qname = store.getAttributeName(attid);
                    String nsuri = qname.getNamespaceURI();
                    String attname = qname.getLocalPart();
                    if(XQueryConstants.XSI_URI.equals(nsuri) && "nil".equals(attname)) {
                        String attval = store.getText(attid);
                        if(attval == null) {
                            return false;
                        }
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 prefix = qname.getPrefix();
        if(prefix.length() == 0) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        return new XString(prefix, NCNameType.NCNAME);
    }
View Full Code Here

        String baseuri = super.baseUri();
        if(baseuri != null) {
            return baseuri;
        }
        for(DMAttribute att : _attributes) {
            QualifiedName attname = att.nodeName();
            if(XMLConstants.XML_NS_URI.equals(attname.getNamespaceURI())
                    && "base".equals(attname.getLocalPart())) {
                String uri = att.getContent();
                setBaseUri(uri);
                return uri;
            }
        }
View Full Code Here

        if(!(trg instanceof QNameValue)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with QNameValue");
        }
        final QNameValue qname = (QNameValue) trg;
        final QualifiedName targetName = qname.getValue();
        if(value.equals(targetName)) {
            return 0;
        } else {
            return value.identity() > qname.value.identity() ? 1 : -1;
        }
View Full Code Here

    public CastingFunction() {
        super();
    }

    public void initialize(String funcName) {
        QualifiedName resolvedName = resolve(funcName);
        this._funcName = resolvedName;
        Type type = obtainType(funcName);
        this._returnType = type;
        final FunctionSignature[] sig = new FunctionSignature[1];
        sig[0] = new FunctionSignature(resolvedName, new Type[] { TypeRegistry.safeGet("xs:anyAtomicType?") });
View Full Code Here

                if(!a2Itor.hasNext()) {
                    return false;
                }
                DMAttribute a1 = a1Itor.next();
                DMAttribute a2 = a2Itor.next();
                QualifiedName a1name = a1.nodeName();
                QualifiedName a2name = a2.nodeName();
                if(!a1name.equals(a2name)) {
                    return false;
                }
                String a1val = a1.getContent();
                String a2val = a2.getContent();
View Full Code Here

            }
        }
    }

    public final int getNameCode() {
        QualifiedName name = nodeName();
        if(name == null) {
            return -1;
        }
        return name.identity();
    }
View Full Code Here

        return expr;
    }

    public XQExpression visit(AttributeConstructor constructor, XQueryContext ctxt)
            throws XQueryException {
        final QualifiedName name = constructor.getName();
        if(name == null) {
            XQExpression nameExpr = constructor.getNameExpr();
            nameExpr.visit(this, ctxt);
        }
        for(XQExpression v : constructor.getValueExprs()) {
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.