NodeProxy tempProxy = new NodeProxy(doc, gid, address);
NodeProxy tempProxy;
	public void index(final NodeImpl node) {		final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument();		final long gid = node.getGID();		final short nodeType = node.getNodeType();		final String nodeName = node.getNodeName();		final long address = node.getInternalAddress();		final IndexPaths idx =			(IndexPaths) idxPathMap.get(node.getOwnerDocument().getDoctype().getName());		if (address < 0)			LOG.debug("node " + gid + ": internal address missing");		final int depth = idx == null ? defaultIndexDepth : idx.getIndexDepth();		final int level = doc.getTreeLevel(gid);		NodeProxy tempProxy = new NodeProxy(doc, gid, address);		QName qname;		switch (nodeType) {			case Node.ELEMENT_NODE :				// save element by calling ElementIndex				qname = node.getQName();				qname.setNameType(ElementValue.ELEMENT);				elementIndex.setDocument(doc);				elementIndex.addRow(qname, tempProxy);				break;			case Node.ATTRIBUTE_NODE :				elementIndex.setDocument(doc);				qname =					new QName(						node.getLocalName(),						node.getNamespaceURI(),						node.getPrefix());				qname.setNameType(ElementValue.ATTRIBUTE);				elementIndex.addRow(qname, tempProxy);				// check if attribute value should be fulltext-indexed				// by calling IndexPaths.match(path) 				if (idx == null || idx.getIncludeAttributes())					textEngine.storeAttribute(idx, (AttrImpl) node);				// if the attribute has type ID, store the ID-value				// to the element index as well				if (((AttrImpl) node).getType() == AttrImpl.ID) {					qname = new QName(((AttrImpl) node).getValue(), "", null);					qname.setNameType(ElementValue.ATTRIBUTE_ID);					elementIndex.addRow(qname, tempProxy);				}				break;			case Node.TEXT_NODE :				// check if this textual content should be fulltext-indexed				// by calling IndexPaths.match(path)				// if (idx == null || idx.match(currentPath))				textEngine.storeText(idx, (TextImpl) node, false);				break;		}		if (nodeType == Node.ELEMENT_NODE && level <= depth) {			new DOMTransaction(this, domDb, Lock.WRITE_LOCK) {				public Object start() throws ReadOnlyException {					try {						domDb.addValue(							new NodeRef(doc.getDocId(), gid),							node.getInternalAddress());					} catch (BTreeException e) {						LOG.warn(EXCEPTION_DURING_REINDEX, e);					} catch (IOException e) {						LOG.warn(EXCEPTION_DURING_REINDEX, e);					}					return null;				}			}			.run();		}	}