Examples of DTMAttribute


Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

    public QName getAttributeName(int index) {
        checkConditionForAttribute();
        final XQNode node = currentEvent_.getNode();
        final QualifiedName attname;
        if(node instanceof DTMElement) {
            final DTMAttribute att = ((DTMElement) node).attribute(index);
            if(att == null) {
                throw new IndexOutOfBoundsException(); // REVIEWME what's needed by the spec ?
            }
            attname = att.nodeName();
        } else if(node instanceof DMElement) {
            AttrNodeSequence<DMAttribute> attributes = ((DMElement) node).attribute();
            final int attrSize = attributes.size();
            if(index >= attrSize) {
                throw new IndexOutOfBoundsException(); // REVIEWME what's needed by the spec ?
            }
            DMAttribute att = attributes.getItem(index);
            attname = att.nodeName();
        } else {
            throw new IllegalStateException("Unexpected node class: " + node.getClass().getName());
        }
        assert (attname != null);
        return QualifiedName.toJavaxQName(attname);
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

    public String getAttributeValue(int index) {
        checkConditionForAttribute();
        final XQNode node = currentEvent_.getNode();
        if(node instanceof DTMElement) {
            final DTMAttribute att = ((DTMElement) node).attribute(index);
            if(att == null) {
                throw new IndexOutOfBoundsException(); // REVIEWME what's needed by the spec ?
            }
            return att.getContent();
        } else if(node instanceof DMElement) {
            AttrNodeSequence<DMAttribute> attributes = ((DMElement) node).attribute();
            final int attrSize = attributes.size();
            if(index >= attrSize) {
                throw new IndexOutOfBoundsException(); // REVIEWME what's needed by the spec ?
            }
            DMAttribute att = attributes.getItem(index);
            return att.getContent();
        } else {
            throw new IllegalStateException("Unexpected node class: " + node.getClass().getName());
        }
    }
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

    }

    private static boolean isLang(DTMElement elem, String lang) {
        assert (lang != null);
        for (DTMElement curNode = elem; curNode != null; curNode = curNode.parent()) {
            DTMAttribute att = null;
            for (int i = 0; (att = curNode.attribute(i)) != null; i++) {
                if (LANG_ELEM.equals(att.nodeName())) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

                }
            }
        } else {
            assert (node instanceof DTMElement);
            DTMElement e = ((DTMElement) node);
            DTMAttribute att = null;
            for(int i = 0; (att = e.attribute(0)) != null; i++) {
                final String attPrefix = att.nodeName().getPrefix();
                if(prefix.equals(attPrefix)) {
                    final String nsuri = att.getNamespaceURI();
                    return nsuri;
                }
            }
        }
        return null;
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

    public String getValue() {
        return currentElement.stringValue();
    }

    public String getAttribute(String attributeName) {
        DTMAttribute attr = currentElement.getAttribute(null, attributeName);
        return attr == null ? null : attr.getContent();
    }
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

        DTMAttribute attr = currentElement.getAttribute(null, attributeName);
        return attr == null ? null : attr.getContent();
    }

    public String getAttribute(int index) {
        DTMAttribute attr = currentElement.attribute(index);
        return attr == null ? null : attr.getContent();
    }
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

    public int getAttributeCount() {
        return currentElement.getAttributesCount();
    }

    public String getAttributeName(int index) {
        DTMAttribute attr = currentElement.attribute(index);
        if(attr == null) {
            return null;
        }
        String rawName = attr.nodeName().getLocalPart();
        return unescapeXmlName(rawName);
    }
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.DTMAttribute

            }
        } else {
            // TODO performance improvement!
            assert (n1 instanceof DTMElement && n2 instanceof DTMElement);
            DTMElement e1 = (DTMElement) n1, e2 = (DTMElement) n2;
            DTMAttribute att1 = null;
            for(int i = 0; (att1 = e1.attribute(i)) != null; i++) {
                DTMAttribute att2 = e2.attribute(i);
                if(!att1.nodeName().equals(att2.nodeName())) {
                    return false;
                }
                final String att1val = att1.getContent();
                final String att2val = att2.getContent();
                if(collator != null) {
                    if(!collator.equals(att1val, att2val)) {
                        return false;
                    }
                } else {
                    if(!att1val.equals(att2.getContent())) {
                        return false;
                    }
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.