protected void makePersistent() throws XPathException { expand(); org.exist.dom.DocumentImpl doc = context.storeTemporaryDoc(this); NodeList cl = doc.getDocumentElement().getChildNodes(); storedNodes = new Int2ObjectHashMap(); int top = size > 1 ? 1 : -1; int i = 0;
public Int2ObjectHashMap makePersistent() throws XPathException { if (size <= 1) return null; List oldIds = new ArrayList(20); int top = 1; while (top > 0) { oldIds.add(new Integer(top)); top = getNextSiblingFor(top); } DocumentImpl expandedDoc = expandRefs(); org.exist.dom.DocumentImpl doc = context.storeTemporaryDoc(expandedDoc); NodeList cl = doc.getDocumentElement().getChildNodes(); storedNodes = new Int2ObjectHashMap(); top = 1; int i = 0;
    protected void makePersistent() throws XPathException {    	expand();    	org.exist.dom.DocumentImpl doc = context.storeTemporaryDoc(this);    	NodeList cl = doc.getDocumentElement().getChildNodes();    	storedNodes = new Int2ObjectHashMap();    	int top = size > 1 ? 1 : -1;    	int i = 0;        while(top > 0 && i < cl.getLength()) {            org.exist.dom.NodeImpl node = (org.exist.dom.NodeImpl) cl.item(i);            NodeProxy proxy = new NodeProxy(doc, node.getGID(), node.getInternalAddress());            System.err.println(top + " = " + proxy.gid);            storedNodes.put(top, proxy);            top = getNextSiblingFor(top);            i++;        }    }