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(); }
TestResultBean testResultBean = new TestResultBean(); for (int j = 0; j < tNode.getChildCount(); j++) { String nn = tNode.getQualifiedName(); if ("run-count".equals(nn)) {
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; }
@Override protected boolean hasChildren(Element element) throws SAXException { try { return element.getChildCount() != 0; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected boolean hasChildren(Element element) throws SAXException { try { return element.getChildCount() != 0; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
private boolean hasChildElements(Element elem) { for (int i = elem.getChildCount(); --i >= 0;) { if (elem.getChild(i) instanceof Element) return true; } return false; }
@Override protected boolean hasChildren(Element element) throws SAXException { try { return element.getChildCount() != 0; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
private boolean hasChildElements(Element elem) { for (int i = elem.getChildCount(); --i >= 0;) { if (elem.getChild(i) instanceof Element) return true; } return false; }
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(); }
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(); }
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; }
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); }
/** 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); } }
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(); }
protected nu.xom.Element toElement(Node node, String name, boolean local) { nu.xom.Element eElem = new nu.xom.Element(name, NS); eElem.addAttribute(new nu.xom.Attribute("id", node.getId())); if (!getType(node.getClass()).equals(name)) { eElem.addAttribute(new nu.xom.Attribute("class", getType(node.getClass()))); } nu.xom.Element eAttributes = toElement(local ? node.getLocalAttributes() : node.getAttributes()); if (eAttributes.getChildCount() > 0) { eElem.appendChild(eAttributes); } return eElem; }