public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
CoreMap sentence = new ArrayCoreMap(); sentence.set(CoreAnnotations.CharacterOffsetBeginAnnotation.class, offset); Tree tree = Tree.valueOf(sentElem.getChild(0).getValue()); // XXX ms: is this the same as sentElem.getText() in JDOM? List<CoreLabel> tokens = new ArrayList<>(); List<Tree> preTerminals = preTerminals(tree);
private Node[] getChildNodes() { Node[] childNodes = new Node[xomElement.getChildCount()]; for (int i = 0; i < xomElement.getChildCount(); i++) { childNodes[i] = xomElement.getChild(i); } return childNodes; }
private Node[] getChildNodes() { Node[] childNodes = new Node[xomElement.getChildCount()]; for (int i = 0; i < xomElement.getChildCount(); i++) { childNodes[i] = xomElement.getChild(i); } return childNodes; }
private boolean hasChildElements(Element elem) { for (int i = elem.getChildCount(); --i >= 0;) { if (elem.getChild(i) instanceof Element) return true; } return false; }
private boolean hasChildElements(Element elem) { for (int i = elem.getChildCount(); --i >= 0;) { if (elem.getChild(i) instanceof Element) return true; } return false; }
private List<Node> nodesBeforeBody(Element html) { List<Node> nodes = new ArrayList<Node>(); for (int i = 0; i < html.getChildCount(); i++) { Node child = html.getChild(i); if (isBodySection(child)) { break; } nodes.add(child); } return nodes; }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
public static String innerToString(Element elm) { StringBuilder sb = new StringBuilder(); for(int i = 0; i<elm.getChildCount(); i++) { Node child = elm.getChild(i); sb.append(child.toXML()); } return sb.toString(); }
private List<Node> nodesBeforeBody(Element html) { List<Node> nodes = new ArrayList<Node>(); for (int i = 0; i < html.getChildCount(); i++) { Node child = html.getChild(i); if (isBodySection(child)) { break; } nodes.add(child); } return nodes; }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
public String getValue() { // currentElement.getValue() not used as this includes text of child elements, which we don't want. StringBuffer result = new StringBuffer(); int childCount = currentElement.getChildCount(); for(int i = 0; i < childCount; i++) { Node child = currentElement.getChild(i); if (child instanceof Text) { Text text = (Text) child; result.append(text.getValue()); } } return result.toString(); }
/** copies children of element make subclasses when required * * @param element to copy from * @param to */ public static void copyChildrenFromTo(Element element, Element to) { for (int i = 0; i < element.getChildCount(); i++) { Node childNode = element.getChild(i); Node newNode = childNode.copy(); to.appendChild(newNode); } }
/** copies children of element make subclasses when required * * @param element to copy from */ public void copyChildrenFrom(Element element) { for (int i = 0; i < element.getChildCount(); i++) { Node childNode = element.getChild(i); Node newNode = childNode.copy(); this.appendChild(newNode); } }
private static STableCell tableCell( final Element e) throws URISyntaxException { final List<STableCellContent> content = new ArrayList<STableCellContent>(); for (int index = 0; index < e.getChildCount(); ++index) { final Node n = e.getChild(index); content.add(SDocumentParser.tableCellContent(n)); } return STableCell.tableCell(content); }
final void writeElement(Element elem) throws IOException { writeStartTag(elem); for (int i = 0; i < elem.getChildCount(); i++) { writeChild(elem.getChild(i)); } writeEndTag(); }
final void writeElement(Element elem) throws IOException { writeStartTag(elem); for (int i = 0; i < elem.getChildCount(); i++) { writeChild(elem.getChild(i)); } writeEndTag(); }