nu.xom.Node.copy()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(101)

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

Node.copy介绍

暂无

代码示例

代码示例来源:origin: org.openbase/jul.extension.xml

public static Node skipNlTabWs(final Node oldDoc) throws CouldNotProcessException {
  Node copy = oldDoc.copy();
  try {
    String oldString = oldDoc.toXML();
    String newString = oldString.replace("\n", "");
    newString = newString.replace("\t", "");
    newString = newString.trim();
    return createDocumentFromString(newString);
  } catch (Exception ex) {
    throw new CouldNotProcessException("Couldn't skipNlTabWs. Returning old document.", ex);
  }
}

代码示例来源: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.xml-cml/cmlxom

/** clone content of element with CountExpression and append.
 * clones the element content and appends to original element content
 * @param element to process
 * @throws RuntimeException null element or bad attribute
 */
public static void cloneContentAndAppend(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 count = cea.calculateCountExpression();
  int nChild = element.getChildCount();
  for (int i = 1; i < count; i++) {
    for (int j = 0; j < nChild; j++) {
      Node newChild = element.getChild(j).copy();
      element.appendChild(newChild);
    }
  }
}

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

return (Element) node.copy(); // atomic values are already properly wrapped
Document doc = (Document) node;                    
for (int j=0; j < doc.getChildCount(); j++) {
  item.appendChild(doc.getChild(j).copy());
item.appendChild(node.copy());

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

return (Element) node.copy(); // atomic values are already properly wrapped
Document doc = (Document) node;                    
for (int j=0; j < doc.getChildCount(); j++) {
  item.appendChild(doc.getChild(j).copy());
item.appendChild(node.copy());

代码示例来源:origin: org.specrunner/specrunner-sql

continue;
TableAdapter copy = UtilTable.newTable(node.copy());
String alias = SRServices.get(IPluginFactory.class).getAlias(PluginJoined.class);
copy.setAttribute(UtilNode.ATT_CSS, table.getAttribute(UtilNode.ATT_CSS).replace(alias, ""));

相关文章