final protected void selectFollowingNode() { ft = true; depth = vn.getCurrentDepth(); iter_type = FOLLOWING_NODE; // contextCopy = (int[])vn.context.clone(); }
final protected void selectDescendantNode() { ft = true; depth = vn.getCurrentDepth(); iter_type = DESCENDANT_NODE; }
final protected void selectNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = SIMPLE_NODE; }
final protected void selectFollowingNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = FOLLOWING_NODE; // contextCopy = (int[])vn.context.clone(); }
final protected void selectDescendantNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = DESCENDANT_NODE; } /**
final protected void selectNode() { ft = true; depth = vn.getCurrentDepth(); iter_type = SIMPLE_NODE; }
final protected void selectDescendantNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = DESCENDANT_NODE; } /**
final protected void selectFollowingNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = FOLLOWING_NODE; // contextCopy = (int[])vn.context.clone(); }
final protected void selectNode(){ ft = true; depth = vn.getCurrentDepth(); iter_type = SIMPLE_NODE; }
/** * Select all descendent elements along the descendent axis, without ns awareness * @param en */ protected void selectElement_D(String en) { if (en == null) throw new IllegalArgumentException("element name can't be null"); iter_type = DESCENDANT; depth = vn.getCurrentDepth(); //startIndex = vn.getCurrentIndex(); name = en; ft = true; }
/** * Select all descendent elements along the descendent axis, without ns awareness * @param en */ protected void selectElement_D(String en) { if (en == null) throw new IllegalArgumentException("element name can't be null"); iter_type = DESCENDANT; depth = vn.getCurrentDepth(); //startIndex = vn.getCurrentIndex(); name = en; ft = true; }
/** * Select all descendent elements along the descendent axis, without ns * awareness * * @param en */ protected void selectElement_D(String en) { if (en == null) throw new IllegalArgumentException("element name can't be null"); iter_type = DESCENDANT; depth = vn.getCurrentDepth(); // startIndex = vn.getCurrentIndex(); name = en; ft = true; }
/** * Select all descendent elements along the Descendent axis, withns awareness * @param ns_URL * @param ln */ protected void selectElementNS_D(String ns_URL, String ln){ if (ln == null) throw new IllegalArgumentException("local name can't be null"); iter_type = DESCENDANT_NS; depth = vn.getCurrentDepth(); //startIndex = vn.getCurrentIndex(); localName = ln; URL = ns_URL; ft = true; }
/** * Select the element name before iterating. * "*" matches every element * Creation date: (12/4/03 5:51:31 PM) * @param en java.lang.String */ public void selectElement(String en) { if (en == null) throw new IllegalArgumentException("element name can't be null"); iter_type = SIMPLE; depth = vn.getCurrentDepth(); //startIndex = vn.getCurrentIndex(); name = en; ft = true; } /**
/** * Select all descendent elements along the Descendent axis, withns awareness * @param ns_URL * @param ln */ protected void selectElementNS_D(String ns_URL, String ln){ if (ln == null) throw new IllegalArgumentException("local name can't be null"); iter_type = DESCENDANT_NS; depth = vn.getCurrentDepth(); //startIndex = vn.getCurrentIndex(); localName = ln; URL = ns_URL; ft = true; }
/** * Select the element name before iterating. "*" matches every element * Creation date: (12/4/03 5:51:31 PM) * * @param en * java.lang.String */ public void selectElement(String en) { if (en == null) throw new IllegalArgumentException("element name can't be null"); iter_type = SIMPLE; depth = vn.getCurrentDepth(); // startIndex = vn.getCurrentIndex(); name = en; ft = true; }
final protected void selectPrecedingNode(){ ft = true; depth = vn.getCurrentDepth(); contextCopy = (int[])vn.context.clone(); if (contextCopy[0]!=-1){ for (int i=contextCopy[0]+1;i<contextCopy.length;i++){ contextCopy[i]=0; } }//else{ // for (int i=1;i<contextCopy.length;i++){ // contextCopy[i]=0; // } //} iter_type = PRECEDING_NODE; endIndex = vn.getCurrentIndex(); }
final protected void selectPrecedingNode(){ ft = true; depth = vn.getCurrentDepth(); contextCopy = (int[])vn.context.clone(); if (contextCopy[0]!=-1){ for (int i=contextCopy[0]+1;i<contextCopy.length;i++){ contextCopy[i]=0; } }//else{ // for (int i=1;i<contextCopy.length;i++){ // contextCopy[i]=0; // } //} iter_type = PRECEDING_NODE; endIndex = vn.getCurrentIndex(); }
/** * Sets the VTDNav cursor the first position after the current element. * * @return The new token index. */ protected int skipElement() { int elementDepth = vn.getCurrentDepth(); int i = vn.getCurrentIndex() + 1; while (i < vn.getTokenCount() && tokenIndexBelongsToElement(i, elementDepth)) { ++i; } return i; }
public static String getElementText(VTDNav vn) throws NavException { StringBuilder sb = new StringBuilder(); int depth = vn.getCurrentDepth(); int i = vn.getCurrentIndex(); while (vn.getTokenType(i) == VTDNav.TOKEN_STARTING_TAG) i++; while (vn.getTokenDepth(i) >= depth && !(vn.getTokenType(i) == VTDNav.TOKEN_STARTING_TAG && vn.getTokenDepth(i) == depth) && i < vn.getTokenCount()) { if (vn.getTokenType(i) == VTDNav.TOKEN_CHARACTER_DATA || vn.getTokenType(i) == VTDNav.TOKEN_CDATA_VAL) sb.append(vn.toString(i)); i++; } return sb.toString(); }