本文整理了Java中nu.xom.Element.getChildCount()
方法的一些代码示例,展示了Element.getChildCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChildCount()
方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getChildCount
暂无
代码示例来源: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: wiztools/rest-client
TestResultBean testResultBean = new TestResultBean();
for (int j = 0; j < tNode.getChildCount(); j++) {
String nn = tNode.getQualifiedName();
if ("run-count".equals(nn)) {
代码示例来源: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: nu.validator.htmlparser/htmlparser
@Override
protected boolean hasChildren(Element element) throws SAXException {
try {
return element.getChildCount() != 0;
} catch (XMLException e) {
fatal(e);
throw new RuntimeException("Unreachable");
}
}
代码示例来源:origin: nu.validator/htmlparser
@Override
protected boolean hasChildren(Element element) throws SAXException {
try {
return element.getChildCount() != 0;
} catch (XMLException e) {
fatal(e);
throw new RuntimeException("Unreachable");
}
}
代码示例来源: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: validator/htmlparser
@Override
protected boolean hasChildren(Element element) throws SAXException {
try {
return element.getChildCount() != 0;
} catch (XMLException e) {
fatal(e);
throw new RuntimeException("Unreachable");
}
}
代码示例来源: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: 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: 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: 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: 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.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: 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();
}
代码示例来源:origin: net.sf.opendse/opendse-io
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;
}
内容来源于网络,如有侵权,请联系作者删除!