LOG.debug("getAncestors found " + r.getLength());
	protected NodeSet getAncestors(		StaticContext context,		DocumentSet documents,		NodeSet contextSet) {		if (!test.isWildcardTest()) {			if (buf == null) {				buf =					(NodeSet) context.getBroker().findElementsByTagName(						documents,						test.getName());			}			NodeSet r =				contextSet.getAncestors(					buf,					axis == Constants.ANCESTOR_SELF_AXIS,					inPredicate);			LOG.debug("getAncestors found " + r.getLength());			return r;		} else {			NodeSet result = new ArraySet(contextSet.getLength());			NodeProxy p;			for (Iterator i = contextSet.iterator(); i.hasNext();) {				p = (NodeProxy) i.next();				if (axis == Constants.ANCESTOR_SELF_AXIS && test.matches(p))					result.add(						new NodeProxy(p.doc, p.gid, p.getInternalAddress()));				while ((p.gid = XMLUtil.getParentId(p.doc, p.gid)) > 0) {					p.nodeType = Node.ELEMENT_NODE;					if (test.matches(p))						result.add(new NodeProxy(p.doc, p.gid));				}			}			return result;		}	}