use of org.exist.dom.NodeListImpl in project exist by eXist-db.
the class ElementImpl method getChildNodes.
@Override
public NodeList getChildNodes() {
// nil elements are rare, so we use 1 here
final NodeListImpl nl = new NodeListImpl(1);
int nextNode = document.getFirstChildFor(nodeNumber);
while (nextNode > nodeNumber) {
final Node n = document.getNode(nextNode);
if (n.getNodeType() != Node.ATTRIBUTE_NODE) {
nl.add(n);
}
nextNode = document.next[nextNode];
}
return nl;
}
use of org.exist.dom.NodeListImpl in project exist by eXist-db.
the class ElementImpl method getElementsByTagName.
private NodeList getElementsByTagName(final QName qname) {
final NodeListImpl nl = new NodeListImpl();
int nextNode = nodeNumber;
final int treeLevel = document.treeLevel[nodeNumber];
while (++nextNode < document.size && document.treeLevel[nextNode] > treeLevel) {
if (document.nodeKind[nextNode] == Node.ELEMENT_NODE) {
final QName qn = document.nodeName[nextNode];
if (qname.matches(qn)) {
nl.add(document.getNode(nextNode));
}
}
}
return nl;
}
Aggregations