contextSet.selectAncestors( currentSet,
currentSet.selectAncestors( contextSet,
	protected NodeSet getAncestors(		XQueryContext context,		NodeSet contextSet) {		NodeSet result;		if (!test.isWildcardTest()) {//			DocumentSet docs = contextSet.getDocumentSet();			DocumentSet docs = getDocumentSet(contextSet);			if (currentSet == null || currentDocs == null || !(docs.equals(currentDocs))) {				currentDocs = docs;				currentSet =					(NodeSet) context.getBroker().findElementsByTagName(						ElementValue.ELEMENT, currentDocs,						test.getName(), null);			}			result =				contextSet.selectAncestors(					currentSet,					axis == Constants.ANCESTOR_SELF_AXIS,					inPredicate);//			LOG.debug("getAncestors found " + result.getLength());		} else {			result = new ExtArrayNodeSet();			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;	}