Package org.w3c.dom

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


                ((ElementImpl) ownerNode).getDefaultAttributes();
            Node d;
            if (defaults != null && (d = defaults.getNamedItem(name)) != null
                && findNamePoint(name, i+1) < 0) {

                NodeImpl clone = (NodeImpl)d.cloneNode(true);
                clone.ownerNode = ownerNode;
                clone.isOwned(true);
                clone.isSpecified(false);
                nodes.setElementAt(clone, i);
            } else {
View Full Code Here


            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;
                        // REVISIT: can we assume that if we reach here it is
                        // always attrNSImpl
                        if (clone instanceof AttrNSImpl) {
                            // we must rely on the name to find a default attribute
View Full Code Here

    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

                       DataType targetDataType,
                       Operation operation,
                       Operation targetOperation) {
        if (Node.class.isAssignableFrom(source.getClass())) {
            Node nodeSource = (Node)source;
            return nodeSource.cloneNode(true);
        }
        return super.copy(source, dataType, targetDataType, operation, targetOperation);
    }

    @Override
View Full Code Here

    }

    public Object copy(Object source) {
        if (Node.class.isAssignableFrom(source.getClass())) {
            Node nodeSource = (Node) source;
            return nodeSource.cloneNode(true);
        }
        return super.copy(source);
    }
}
View Full Code Here

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

    @Override
View Full Code Here

        root.insertBefore(imported, preload.item(0));
      } else {
        root.appendChild(imported);
      }
      // Adds blocking region measures
      Element dropRate = (Element) lastMeasure.cloneNode(true);
      dropRate.setAttribute(XMLConstantNames.XML_A_MEASURE_NODETYPE, XMLConstantNames.NODETYPE_REGION);
      dropRate.setAttribute(XMLConstantNames.XML_A_MEASURE_STATION, name);
      dropRate.setAttribute(XMLConstantNames.XML_A_MEASURE_TYPE, SimulationDefinition.MEASURE_DR);
      // For each class add drop rate measure
      for (int j = 0; j < exact.getClasses(); j++) {
View Full Code Here

            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

            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

        path = this.createPath(path);

        try {
            result = DOMUtil.getSingleNode(data, path, this.xpathProcessor);
            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

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.