List of usage examples for org.jsoup.nodes Element nextSibling
public Node nextSibling()
From source file:mml.handler.post.MMLPostHTMLHandler.java
/** * Get the next word AFTER the given element * @param node the node after which we seek the next word * @return the word//ww w. java2 s.co m */ String nextWord(Element node) { StringBuilder word = new StringBuilder(); Node next = node.nextSibling(); String text = ""; if (next != null) { if (next instanceof TextNode) { text = ((TextNode) next).text(); } else if (next instanceof Element) { text = getTextOf(next); } } text = text.trim(); for (int i = 0; i < text.length(); i++) if (!Character.isWhitespace(text.charAt(i))) word.append(text.charAt(i)); else break; return word.toString(); }