Package org.w3c.dom

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


          jobChainElement.appendChild(nodeElement);             

        } // if
      } // while
     
      jobChainDocument.appendChild(jobChainElement);
      String xmlString = dom2String(jobChainDocument);
     
      int objectId = settings.getLockedSequence("scheduler","counter","scheduler_managed_objects.id");
      String spoolerID = "NULL";
      if (chain.get("spooler_id")!=null && chain.get("spooler_id").toString().length()>0){
View Full Code Here


    boolean rc = true;
    try{
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();               
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            Document eventDocument = docBuilder.newDocument();
            eventDocument.appendChild(eventDocument.createElement("events"));
           
            JobSchedulerEventJob.readEventsFromDB(getConnection(), spooler, eventDocument, getLogger());
           
            // merge params
      Variable_set params = spooler.create_variable_set();
View Full Code Here

            System.out.println ("Could not create document :"  + pcerr);           
            // Have to exit ---
        }             
       
        Element newModel = (Element) doc.importNode(model, true);
        doc.appendChild(newModel);
        Collection modelElements = new Vector ();           
        Element docElem = doc.getDocumentElement();
        modelElements.add(docElem);
        treeview.addModelElements(modelElements);
        frame.getContentPane().add(new JScrollPane(treeview), BorderLayout.CENTER);           
View Full Code Here

  public static Document createXML(final String rootElement) {
    final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    try {
      final DocumentBuilder db = dbf.newDocumentBuilder();
      final Document res = db.newDocument();
      res.appendChild(res.createElement(rootElement));
      return res;
    } catch (Exception e) {
      throw new BuildException("Failed to create new DOM-document:" +e, e);
    }
  }
View Full Code Here

 
  protected void createXML() {
    Tracing.logDebug("Creating catalog export XML file...", CatalogExportModuleDispatcher.class);
    Document doc = domBuilder.newDocument();                                    // create new XML document
    Element cat = doc.createElement(XML_CAT);                                    // catalog element
    doc.appendChild(cat);
    cat.setAttribute("date", String.valueOf(System.currentTimeMillis()));        // set date in catalog element
    Element root = doc.createElement(XML_NODE);                                  // root node
    root.setAttribute("name", "root");
    cat.appendChild(root);
   
View Full Code Here

    boolean rc = true;
    try {
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
      Document eventDocument = docBuilder.newDocument();
      eventDocument.appendChild(eventDocument.createElement("events"));
      this.setEvents(eventDocument);
      // fetch events from global Job Scheduler variable
      this.getSchedulerEvents();
      this.setParameters(spooler.create_variable_set());
      HashSet jobParameterNames = new HashSet();
View Full Code Here

  public void removeAllEvents() throws Exception {
    try {
      getLogger().info("event class is: " + EVENT_CLASS_ALL_EVENTS + ". Removing all events.");
      Document eventDocument = getEvents();
      eventDocument.removeChild(eventDocument.getFirstChild());
      eventDocument.appendChild(eventDocument.createElement("events"));
      if (this.getConnection() != null) {
        String stmt = "DELETE FROM " + this.getTableEvents() + " WHERE 1>0";
        this.getConnection().executeUpdate(stmt);
        this.getConnection().commit();
      }
View Full Code Here

  public String xmlNodeToString(Node node) throws Exception {
    try {
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
      Document document = docBuilder.newDocument();
      document.appendChild(document.importNode(node, true));
      StringWriter out = new StringWriter();
      XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(document));
      serializer.serialize(document);
      return out.toString();
    }
View Full Code Here

       
        // Convert the Node elements to an XML DOM representation
        Document tempDocument = new DocumentImpl();
        Element tempRootElement = tempDocument.createElement("GISToolkit");     // Create Root Element
        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
View Full Code Here

       
        // Convert the Node elements to an XML DOM representation
        Document tempDocument = new DocumentImpl();
        Element tempRootElement = tempDocument.createElement("GISToolkit");     // Create Root Element
        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
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.