Package org.w3c.dom

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


      }
  }

  // Append this new node onto current stack node
  Node last = (Node)_nodeStk.peek();
  last.appendChild(tmp);

  // Push this node onto stack
  _nodeStk.push(tmp);
    }
View Full Code Here


     */
    public void processingInstruction(String target, String data) {
  final Node last = (Node)_nodeStk.peek();
  ProcessingInstruction pi = _document.createProcessingInstruction(
    target, data);
  if (pi != nulllast.appendChild(pi);
    }

    /**
     * This class is only used internally so this method should never
     * be called.
View Full Code Here

     * Lexical Handler method to create comment node in DOM tree.
     */
    public void comment(char[] ch, int start, int length) {
  final Node last = (Node)_nodeStk.peek();
  Comment comment = _document.createComment(new String(ch,start,length));
  if (comment != null) last.appendChild(comment);
    }

    // Lexical Handler methods- not implemented
    public void startCDATA() { }
    public void endCDATA() { }
View Full Code Here

        } else {
            packagename = doc.createElementNS(ToolConstants.NS_JAXB_BINDINGS, "package");
        }
        packagename.setAttributeNS(null, "name", packagevalue);

        schemaBindings.appendChild(packagename);

        return schemaBindings.getParentNode().getParentNode();
    }

    /**
 
View Full Code Here

        // If deep, replicate and attach the kids.
        if (deep && !(importedNode instanceof Attr)) {
            for (Node srckid = importedNode.getFirstChild(); srckid != null;
                 srckid = srckid.getNextSibling()) {
                newNode.appendChild(importNode(srckid, true));
            }
        }

        return newNode;
View Full Code Here

                                                     atts.getLocalName(i));
                        attr.setNodeValue(atts.getValue(i));
                        ((Element)top).setAttributeNodeNS(attr);
                    }
                }
                previousTop.appendChild(top);
                depth++;
            } catch (DOMException e) {
                throw new SAXException(e.getMessage());
            }
View Full Code Here

        Attr enabled = document.createAttribute(ENABLED_ATTRIBUTE);
        enabled.setValue(template.isEnabled() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
        attributes.setNamedItem(enabled);

        Text pattern = document.createTextNode(template.getPattern());
        node.appendChild(pattern);
      }

      Transformer transformer = TransformerFactory.newInstance()
          .newTransformer();
      transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
View Full Code Here

    if (null != currentNode) {
      if (currentNode == m_root && m_nextSibling != null)
        currentNode.insertBefore(newNode, m_nextSibling);
      else
        currentNode.appendChild(newNode);

      // System.out.println(newNode.getNodeName());
    } else if (null != m_docFrag) {
      if (m_nextSibling != null)
        m_docFrag.insertBefore(newNode, m_nextSibling);
View Full Code Here

      NodeList list = testRooth.getChildNodes();
     
      if (add_remove) {
        Element test = doc.createElement("test_path");
        test.appendChild(doc.createTextNode(testPath));
        testRooth.appendChild(test);
      } else {
        for (int i=0; i<list.getLength(); i++) {
          Node node = list.item(i);
          if (testPath.equals(node.getNodeName())) {
            testRooth.removeChild(node);
View Full Code Here

   private void addApplication(Document doc, String deployName, String archiveName, String type)
   {
      NodeList rootList = doc.getElementsByTagName("server");
      Node root = rootList.item(0);
      root.appendChild(createApplication(doc, deployName, archiveName, type));
   }

   private void removeApplication(Document doc)
   {
      Node server = doc.getElementsByTagName("server").item(0);
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.