Package nu.xom

Examples of nu.xom.Element.copy()


        Element root = new Element("root");
        Document doc = new Document(root);
        Element dataElement = dataDoc.getRootElement();
       
        for (int i = 0; i < 20000; i++) {
            root.appendChild(dataElement.copy());
        }
       
        System.out.println("Ready to bench");
        Thread.sleep(5000);
       
View Full Code Here


        Document doc = new Document(root);
        Element dataElement = dataDoc.getRootElement();

       
        for (int i = 0; i < 30000; i++) {
            root.appendChild(dataElement.copy());
        }
       
        System.out.println("Built document: "
          + (r.totalMemory() - r.freeMemory())/(1024.0*1024) + "MB");
        System.gc(); System.gc(); System.gc();
View Full Code Here

        Document doc = new Document(root);
        Element dataElement = dataDoc.getRootElement();
       
        long pre = System.currentTimeMillis();
        for (int i = 0; i < 20000; i++) {
            root.appendChild(dataElement.copy());
        }
        long post = System.currentTimeMillis();
        System.out.println((post - pre)/1000.0 + "s to build document by copying");
         
        pre = System.currentTimeMillis();
View Full Code Here

        Element root = new Element("root");
        Document doc = new Document(root);
        doc.setBaseURI("http://www.example.com");
        Element child = new Element("child");
        root.appendChild(child);
        Node copy = child.copy();
        assertEquals("http://www.example.com", copy.getBaseURI());
       
    }
   
   
View Full Code Here

      if(!a.equals(b)) {
        System.err.println("Yikes!");
        System.err.println(a);
        System.err.println(b);
      }
      e = (Element)e.copy();
      e.addAttribute(new Attribute("XPoint", xPoint));
      sb.addScrap(e, null);
    }
       
    if(ptsx != null) sb.addPubXMLDoc(ptsx);
View Full Code Here

      if(!a.equals(b)) {
        System.out.println("Yikes!");
        System.out.println(a);
        System.out.println(b);
      }
      e = (Element)e.copy();
      e.addAttribute(new Attribute("XPoint", xPoint));
      ap.addScrap(e, null);
    return ap;
  }
 
View Full Code Here

        Element root = new Element("root");
        Document doc = new Document(root);
        doc.setBaseURI("http://www.example.com");
        Element child = new Element("child");
        root.appendChild(child);
        Node copy = child.copy();
        assertEquals("http://www.example.com", copy.getBaseURI());
       
    }
   
   
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.