Package org.w3c.dom

Examples of org.w3c.dom.Document.createAttribute()


    // new attribute
    Document doc = getOwnerDocument();
    if (doc == null)
      return;
    attr = doc.createAttribute(name);
    if (attr == null)
      return;
    attr.setValue(value);
    appendAttributeNode(attr);
  }
View Full Code Here


            }
        }
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(ns,
                                         "wsp:" + PolicyConstants.POLICYREFERENCE_ELEM_NAME);
        Attr att = doc.createAttribute("URI");
        att.setValue(uri);
        el.setAttributeNodeNS(att);
        return el;
    }
View Full Code Here

      if (oldDate == null) {
        System.err.println("Attr == null");
        continue;
      }
      Element newEventList = newDocument.createElement(TAG_SESSION_EVENT_LIST);
      Attr newDate = newDocument.createAttribute(oldDate.getName());
      newDate.setValue(oldDate.getValue());
      newEventList.setAttributeNode(newDate);
      newRoot.appendChild(newEventList);
     
      NodeList oldEvents = oldEventList.getElementsByTagName(TAG_PERSPECTIVE_EVENT);
View Full Code Here

          System.err.println("Duration == null");
          continue;
        }
       
        Element newEvent = newDocument.createElement(TAG_SESSION_EVENT);
        Attr newDuration = newDocument.createAttribute(oldDuration.getName());
        newDuration.setValue(oldDuration.getValue());
        newEvent.setAttributeNode(newDuration);
        newEventList.appendChild(newEvent);
      }
    }
View Full Code Here

                IvyClasspathContainerImpl ivycp = (IvyClasspathContainerImpl) it.next();

                Node node = document.createElement(IVYCP);
                root.appendChild(node);
                NamedNodeMap attributes = node.getAttributes();
                Attr attr = document.createAttribute(PATH);
                attr.setValue(ivycp.getPath().toString());
                attributes.setNamedItem(attr);

                attr = document.createAttribute(PROJECT);
                attr.setValue(ivycp.getConf().getProject().getName());
View Full Code Here

                NamedNodeMap attributes = node.getAttributes();
                Attr attr = document.createAttribute(PATH);
                attr.setValue(ivycp.getPath().toString());
                attributes.setNamedItem(attr);

                attr = document.createAttribute(PROJECT);
                attr.setValue(ivycp.getConf().getProject().getName());
                attributes.setNamedItem(attr);

                writeCpEntries(ivycp, document, node, ivycp.getClasspathEntries());
View Full Code Here

                StandaloneRetrieveSetup setup = (StandaloneRetrieveSetup) it.next();

                Node node = document.createElement(SETUP);
                root.appendChild(node);
                NamedNodeMap attributes = node.getAttributes();
                Attr attr = document.createAttribute(SETUP_NAME);
                attr.setValue(setup.getName());
                attributes.setNamedItem(attr);

                attr = document.createAttribute(RESOLVE_IN_WORKSPACE);
                attr.setValue(Boolean.toString(setup.isResolveInWorkspace()));
View Full Code Here

                NamedNodeMap attributes = node.getAttributes();
                Attr attr = document.createAttribute(SETUP_NAME);
                attr.setValue(setup.getName());
                attributes.setNamedItem(attr);

                attr = document.createAttribute(RESOLVE_IN_WORKSPACE);
                attr.setValue(Boolean.toString(setup.isResolveInWorkspace()));
                attributes.setNamedItem(attr);

                if (setup.isSettingProjectSpecific()) {
                    Node settingsNode = document.createElement(IVYSETTINGS);
View Full Code Here

       
        Document document = DOMUtil.getOwnerDocument(nodeObj);
        Node newNode = null;
        if (part instanceof AttributePart) {
            if (StringUtil.isEmpty(part.getPrefix())) {
                newNode = document.createAttribute(part.getName());
                nodeObj.getAttributes().setNamedItem(newNode);
            } else {
                String nsURI = getNamespaceURI(namespaceContext, part.getPrefix());
                newNode = document.createAttributeNS(nsURI, part.getName());
                newNode.setPrefix(part.getPrefix());
View Full Code Here

      target.appendChild(targetChild);

      for (Map.Entry<String, String> attribute : source.getAttributes().entrySet())
      {
         Attr attr = owned.createAttribute(attribute.getKey());
         attr.setValue(attribute.getValue());

         targetChild.getAttributes().setNamedItem(attr);
      }
      for (Node sourceChild : source.getChildren())
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.