nu.xom.Element.getChild()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中nu.xom.Element.getChild()方法的一些代码示例,展示了Element.getChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChild()方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getChild

Element.getChild介绍

暂无

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

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();
}

代码示例来源:origin: stanfordnlp/CoreNLP

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);

代码示例来源:origin: concordion/concordion

private Node[] getChildNodes() {
  Node[] childNodes = new Node[xomElement.getChildCount()];
  for (int i = 0; i < xomElement.getChildCount(); i++) {
    childNodes[i] = xomElement.getChild(i);
  }
  return childNodes;
}

代码示例来源:origin: org.concordion/concordion

private Node[] getChildNodes() {
  Node[] childNodes = new Node[xomElement.getChildCount()];
  for (int i = 0; i < xomElement.getChildCount(); i++) {
    childNodes[i] = xomElement.getChild(i);
  }
  return childNodes;
}

代码示例来源:origin: teiid/teiid

private boolean hasChildElements(Element elem) {
  for (int i = elem.getChildCount(); --i >= 0;) {
    if (elem.getChild(i) instanceof Element) return true;
  }
  return false;
}

代码示例来源:origin: org.teiid/saxon-xom

private boolean hasChildElements(Element elem) {
  for (int i = elem.getChildCount(); --i >= 0;) {
    if (elem.getChild(i) instanceof Element) return true;
  }
  return false;
}

代码示例来源:origin: org.concordion/concordion

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;
}

代码示例来源:origin: org.jvnet.hudson/xstream

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();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

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();
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient

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();
}

代码示例来源:origin: se.vgregion.pubsubhubbub/pubsubhubbub-hub-composite-pubsub

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();
}

代码示例来源:origin: concordion/concordion

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;
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

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();
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

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();
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

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();
}

代码示例来源:origin: org.xml-cml/cmlxom

/** 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);
  }
}

代码示例来源:origin: org.xml-cml/cmlxom

/** 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);
  }
}

代码示例来源:origin: com.io7m.jstructural/io7m-jstructural-xom

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);
}

代码示例来源:origin: org.teiid/saxon-xom

final void writeElement(Element elem) throws IOException {	
  writeStartTag(elem);
  
  for (int i = 0; i < elem.getChildCount(); i++) {
    writeChild(elem.getChild(i));
  }
      
  writeEndTag();
}

代码示例来源:origin: teiid/teiid

final void writeElement(Element elem) throws IOException {	
  writeStartTag(elem);
  
  for (int i = 0; i < elem.getChildCount(); i++) {
    writeChild(elem.getChild(i));
  }
      
  writeEndTag();
}

相关文章