if (t.isText()) { sb.append(cursor.getTextValue()); } else if (isStartToken(cursor, "tr")) {
if (t.isText()) { sb.append(cursor.getTextValue()); } else if (isStartToken(cursor, "tr")) {
if (tt.isText())
while (true) if (tt.isText())
/** * Computes how many text nodes the * @param c the position in the document * @return how many text nodes occur before the position determined by <code>c</code> */ private static int countTextTokens(XmlCursor c) { int k = 0; int l = 0; XmlCursor d = c.newCursor(); c.push(); c.toParent(); TokenType tt = c.toFirstContentToken(); while (!tt.isEnd()) { if (tt.isText()) { if (c.comparePosition(d) > 0) // We have moved after the initial position l++; else k++; } else if (tt.isStart()) c.toEndToken(); tt = c.toNextToken(); } c.pop(); return l == 0 ? 0 : k; }
/** * Computes how many text nodes the * @param c the position in the document * @return how many text nodes occur before the position determined by <code>c</code> */ private static int countTextTokens(XmlCursor c) { int k = 0; int l = 0; XmlCursor d = c.newCursor(); c.push(); c.toParent(); TokenType tt = c.toFirstContentToken(); while (!tt.isEnd()) { if (tt.isText()) { if (c.comparePosition(d) > 0) // We have moved after the initial position l++; else k++; } else if (tt.isStart()) c.toEndToken(); tt = c.toNextToken(); } c.pop(); return l == 0 ? 0 : k; }
/** * Computes how many text nodes the * @param c the position in the document * @return how many text nodes occur before the position determined by <code>c</code> */ private static int countTextTokens(XmlCursor c) { int k = 0; int l = 0; XmlCursor d = c.newCursor(); c.push(); c.toParent(); TokenType tt = c.toFirstContentToken(); while (!tt.isEnd()) { if (tt.isText()) { if (c.comparePosition(d) > 0) // We have moved after the initial position l++; else k++; } else if (tt.isStart()) c.toEndToken(); tt = c.toNextToken(); } c.pop(); return l == 0 ? 0 : k; }