本文整理了Java中nu.xom.Element.indexOf()
方法的一些代码示例,展示了Element.indexOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.indexOf()
方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:indexOf
暂无
代码示例来源:origin: nu.validator.htmlparser/htmlparser
private int indexOfTable(Element table, Element stackParent) {
if (table == cachedTable) {
return cachedTableIndex;
} else {
cachedTable = table;
return (cachedTableIndex = stackParent.indexOf(table));
}
}
代码示例来源:origin: nu.validator/htmlparser
private int indexOfTable(Element table, Element stackParent) {
if (table == cachedTable) {
return cachedTableIndex;
} else {
cachedTable = table;
return (cachedTableIndex = stackParent.indexOf(table));
}
}
代码示例来源:origin: validator/htmlparser
private int indexOfTable(Element table, Element stackParent) {
if (table == cachedTable) {
return cachedTableIndex;
} else {
cachedTable = table;
return (cachedTableIndex = stackParent.indexOf(table));
}
}
代码示例来源:origin: concordion/concordion
public void appendSister(Element element) {
nu.xom.Element xomParentElement = (nu.xom.Element) xomElement.getParent();
int elementIndex = xomParentElement.indexOf(xomElement);
xomParentElement.insertChild(element.xomElement, elementIndex + 1);
}
代码示例来源:origin: org.concordion/concordion
public void appendSister(Element element) {
nu.xom.Element xomParentElement = (nu.xom.Element) xomElement.getParent();
int elementIndex = xomParentElement.indexOf(xomElement);
xomParentElement.insertChild(element.xomElement, elementIndex + 1);
}
代码示例来源:origin: org.xml-cml/cmlxom
/** replace current element by its child nodes.
* does not work for root node
*
*/
public void replaceByChildren() {
Node parent = this.getParent();
if (parent == null) {
} else if (!(parent instanceof Element)) {
} else {
Element parentElement = (Element) parent;
int idx = parentElement.indexOf(this);
List<Node> nodeList = new ArrayList<Node>();
for (int i = 0; i < this.getChildCount(); i++) {
nodeList.add(this.getChild(i));
}
for (int i = 0; i < nodeList.size(); i++) {
Node node = nodeList.get(i);
node.detach();
parentElement.insertChild(node, idx + i);
}
}
this.detach();
}
/**
代码示例来源:origin: org.xml-cml/cmlxom
/** clone element with a repeat attribute.
* clones the element and appends to original element
* @param element to process
* @throws RuntimeException null element or bad attribute
*/
public static void generateAndInsertClones(CMLElement element) throws RuntimeException {
if (element == null) {
throw new RuntimeException("Cannot process null element");
}
Element parent = (Element) element.getParent();
if (parent == null) {
throw new RuntimeException("Cannot process CountExpressionAttribute without parent");
}
CountExpressionAttribute cea = (CountExpressionAttribute)
element.getAttribute(CountExpressionAttribute.NAME);
int idx = parent.indexOf(element);
int count = cea.calculateCountExpression();
for (int i = 1; i < count; i++) {
Element newElement = (Element) element.copy();
parent.insertChild(newElement, idx+1);
}
}
内容来源于网络,如有侵权,请联系作者删除!