} result = currentSet.selectSiblings( contextSet, axis == Constants.PRECEDING_SIBLING_AXIS ? NodeSet.PRECEDING : NodeSet.FOLLOWING);
} switch (axis) { case Constants.PRECEDING_SIBLING_AXIS : result = currentSet.selectSiblings(contextSet, NodeSet.PRECEDING); break; case Constants.FOLLOWING_SIBLING_AXIS : result = currentSet.selectSiblings(contextSet, NodeSet.FOLLOWING); break; default : throw new IllegalArgumentException("Unsupported axis specified"); }
	protected NodeSet getSiblings(		XQueryContext context,		NodeSet contextSet) {		NodeSet result;		if (!test.isWildcardTest()) {		    DocumentSet docs = getDocumentSet(contextSet);//			DocumentSet docs = contextSet.getDocumentSet();			if (currentSet == null || currentDocs == null || !(docs.equals(currentDocs))) {				currentDocs = docs;				currentSet =					(NodeSet) context.getBroker().getElementIndex().findElementsByTagName(						ElementValue.ELEMENT, currentDocs,						test.getName(), null);				registerUpdateListener();			}			result = currentSet.selectSiblings(				contextSet,				axis == Constants.PRECEDING_SIBLING_AXIS					? NodeSet.PRECEDING					: NodeSet.FOLLOWING);		} else {			result = new ArraySet(contextSet.getLength());			NodeProxy p, sib;			NodeImpl n;			for (Iterator i = contextSet.iterator(); i.hasNext();) {				p = (NodeProxy) i.next();				n = (NodeImpl) p.getNode();				while ((n = getNextSibling(n)) != null) {					if (test.matches(n)) {						sib = new NodeProxy((DocumentImpl) n.getOwnerDocument(), n.getGID(),								n.getInternalAddress());                        if (inPredicate)                            sib.addContextNode(p);                        else                            sib.copyContext(p);                        result.add(sib);					}				}			}		}		return result;	}