if (node == doc.getDocumentElement())
return "de";
Node parentNode = node.getParentNode();
if (parentNode == null)
throw new ItsNatException("Unexpected error");
int pos = 0; // la posici�n del nodo o la del nodo de texto pero ignorando los nodos de texto anteriores
Node currNode = parentNode.getFirstChild();
while(currNode != null)
{
if (!isFilteredInClient(currNode))
{
if (currNode == node)
return Integer.toString(pos); // As� admitimos que currNode pueda ser un Text Node
if (currNode.getNodeType() != Node.TEXT_NODE)
pos++; // Ignoramos los nodos de texto excepto el dado como argumento (si es un Text Node)
}
currNode = currNode.getNextSibling();
}
throw new ItsNatException("Node not found in document to calculate paths",node);
//return "-1";
}