Package nu.xom

Examples of nu.xom.Node.copy()


            atomics.append(' ');
          }
          atomics.append(value);
        } else if (parent != null) {
          if (size > 1 && !identities.add(result)) {
            result = result.copy(); // multiple identical nodes in results
//            throw new MultipleParentException(
//            "XQuery morpher result sequence must not contain multiple identical nodes");
          }
          boolean isRoot = parent instanceof Document && node instanceof Element;
          if (!isInitialized) {
View Full Code Here


   
  public static Element renameElement(Element element, String newLocalName) {
    Element newElement = new Element(newLocalName, XHTML_NS);
    for (int i = 0; i < element.getChildCount(); i++) {
      Node child = element.getChild(i);
      newElement.appendChild(child.copy());
    }
    for (int i = 0; i < element.getAttributeCount(); i++) {
      Attribute a = element.getAttribute(i);     
      newElement.addAttribute((Attribute)a.copy());
    }
View Full Code Here

   * Append the child nodes of source to destination, copying them from the source.
   */
  public static void appendChildren(Element destination, Element source) {
    for (int i = 0; i < source.getChildCount(); i++) {
      Node node = source.getChild(i)
      destination.appendChild(node.copy());
    }       
  }
 
  /**
   * Append the children nodes to parent, copying them from the source.
View Full Code Here

   * Append the children nodes to parent, copying them from the source.
   */
  public static void appendChildren(Element parent, Nodes children) {
    for (int i = 0; i < children.size(); i++) {
      Node node = children.get(i);
      parent.appendChild(node.copy());
    }
  }
 
  /**
   * Retrieve the nearest ancestor element that has the given attribute,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.