ArraySet parents = new ArraySet(getLength()); NodeProxy p; long pid; for(Iterator i = iterator(); i.hasNext(); ) { p = (NodeProxy)i.next();  pid = XMLUtil.getParentId(p.doc, p.gid); parents.add(new NodeProxy(p.doc, pid, Node.ELEMENT_NODE)); } return parents; }
ArraySet parents = new ArraySet(getLength()); NodeProxy p; long pid; for (Iterator i = iterator(); i.hasNext();) { p = (NodeProxy) i.next();  pid = XMLUtil.getParentId(p.doc, p.gid); if (pid > -1) parents.add(new NodeProxy(p.doc, pid, Node.ELEMENT_NODE)); } return parents; }
    public NodeSet getParents() {        ArraySet parents = new ArraySet(getLength());        NodeProxy p;        long pid;        for(Iterator i = iterator(); i.hasNext(); ) {            p = (NodeProxy)i.next();            // calculate parent's gid            pid = XMLUtil.getParentId(p.doc, p.gid);            parents.add(new NodeProxy(p.doc, pid, Node.ELEMENT_NODE));        }        return parents;    }