Examples of cloneNode()


Examples of org.w3c.dom.Node.cloneNode()

     
      // Need to construct DOM element for message
      mesgElem = createMessage();
     
      // Transfer value into this message element
      node = (Node)node.cloneNode(true);
     
      Element partElem=mesgElem.getOwnerDocument().createElement(requestPartName);
      mesgElem.appendChild(partElem);
     
      node = (Node)mesgElem.getOwnerDocument().adoptNode(node);
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

            Node d;
            if (defaults != null &&
                (d = defaults.getNamedItem(name)) != null &&
                findNamePoint(name, index+1) < 0) {
                    NodeImpl clone = (NodeImpl)d.cloneNode(true);
                    if (d.getLocalName() !=null){
                            // we must rely on the name to find a default attribute
                            // ("test:attr"), but while copying it from the DOCTYPE
                            // we should not loose namespace URI that was assigned
                            // to the attribute in the instance document.
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

            if (defaults != null
                    && (d = defaults.getNamedItem(nodeName)) != null)
            {
                int j = findNamePoint(nodeName,0);
                if (j>=0 && findNamePoint(nodeName, j+1) < 0) {
                    NodeImpl clone = (NodeImpl)d.cloneNode(true);
                    clone.ownerNode = ownerNode;
                    if (d.getLocalName() != null) {
                        // we must rely on the name to find a default attribute
                        // ("test:attr"), but while copying it from the DOCTYPE
                        // we should not loose namespace URI that was assigned
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

                if (valueNode instanceof Element
                    || valueNode instanceof Document) {
                    children = valueNode.getChildNodes();
                    for (int i = 0; i < children.getLength(); i++) {
                        Node child = children.item(i);
                        node.appendChild(child.cloneNode(true));
                    }
                }
                else {
                    node.appendChild(valueNode.cloneNode(true));
                }
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

    int length = this.attrNodes.getLength();
    for (int i = 0; i < length; i++) {
      Node node = this.attrNodes.item(i);
      if (node == null)
        continue;
      Attr cloned = (Attr) node.cloneNode(false);
      if (cloned != null)
        element.appendAttributeNode(cloned);
    }
  }
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

        path = this.createPath(path);

        try {
            result = DOMUtil.getSingleNode(data, path);
            if (result != null) result = result.cloneNode(true);
        } catch (javax.xml.transform.TransformerException localException) {
            throw new ProcessingException("TransformerException: " + localException, localException);
        }

        return result;
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

            x++;
            firstInstanceOfH2 = true;
          }
          if (firstInstanceOfH2) {
            if (node2 == node.getLastChild()) {
              pNode.appendChild(node2.cloneNode(true));
            } else {
              Node nextNode = node2.getNextSibling();
              pNode.appendChild(node2.cloneNode(true));
              if (nextNode.getNodeName().equalsIgnoreCase("h2")
                  || nextNode.getNodeName().equalsIgnoreCase(
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

                    element = doc.createElementNS(CIncludeTransformer.CINCLUDE_NAMESPACE_URI, NAME_ELEMENT);
                    parameter.appendChild(element);
                    element.appendChild(doc.createTextNode(parameterName));
                    element = doc.createElementNS(CIncludeTransformer.CINCLUDE_NAMESPACE_URI, VALUE_ELEMENT);
                    parameter.appendChild(element);
                    element.appendChild(valueNode.cloneNode(true));
                } catch (Exception local) {
                    // the exception is ignored and only this parameters is ignored
                }
            }
        }
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

                    nodes.add(attrs.item(i));
                }
                for (int i = 0; i < nodes.size(); i++) {
                    Node node = nodes.get(i);
                    if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
                        newElement.setAttributeNodeNS((Attr)node.cloneNode(true));
                    } else {
                        newElement.appendChild(nodes.get(i));
                    }
                }
                return newElement;
View Full Code Here

Examples of org.w3c.dom.Node.cloneNode()

    @Override
    public Object copy(Object source) {
        if (Node.class.isAssignableFrom(source.getClass())) {
            Node nodeSource = (Node)source;
            return nodeSource.cloneNode(true);
        }
        return super.copy(source);
    }

    @Override
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.