• 大小: 11.15MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-14
  • 语言: Java
  • 标签: dom4j  

资源简介

里面包括了dom4j所有的jar包和文档,完整版

资源截图

代码片段和文件信息


import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.XPath;
import org.dom4j.io.DOMWriter;
import org.dom4j.io.DocumentResult;
import org.dom4j.io.DocumentSource;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.xmlWriter;

public class PerfDOM4J {

    public static void main(String args[]) {
        Document doc;

        try {
            int numrec = 1;

            numrec = 10000;
            System.out.println(“\n10000 Elements ------------------“);
            doc = PerfDOM4J.createDocument(numrec 20 1);
            PerfDOM4J.createW3CDOM(doc);
            PerfDOM4J.write(doc “dom4j_“ + numrec + “.xml“);
            // PerfDOM4J.parse(numrec1);
            // PerfDOM4J.transform(doc“item.xslt“1);
            PerfDOM4J.xpath(doc “/*/*/Attr1x1“ 1);
            PerfDOM4J.xpath(doc “/*/*/Attr1x5000“ 1);
            PerfDOM4J.xpath(doc “/*/*/Attr1x9999“ 1);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x1“ 1);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x5000“ 1);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x9999“ 1);
            PerfDOM4J.xpathNodes(doc “/*/Item“ 3);

            numrec = 1000;
            System.out.println(“\n1000 Elements -------------------“);
            doc = PerfDOM4J.createDocument(numrec 20 1);
            PerfDOM4J.createW3CDOM(doc);
            PerfDOM4J.write(doc “dom4j_“ + numrec + “.xml“);
            PerfDOM4J.parse(numrec 3);
            PerfDOM4J.transform(doc “item.xslt“ 3);
            PerfDOM4J.xpath(doc “/*/*/Attr1x1“ 3);
            PerfDOM4J.xpath(doc “/*/*/Attr1x500“ 3);
            PerfDOM4J.xpath(doc “/*/*/Attr1x999“ 3);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x1“ 3);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x500“ 3);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x999“ 3);
            PerfDOM4J.xpathNodes(doc “/*/Item“ 10);

            numrec = 100;
            System.out.println(“\n100 Elements --------------------“);
            doc = PerfDOM4J.createDocument(numrec 20 10);
            PerfDOM4J.createW3CDOM(doc);
            PerfDOM4J.write(doc “dom4j_“ + numrec + “.xml“);
            PerfDOM4J.parse(numrec 10);
            PerfDOM4J.transform(doc “item.xslt“ 10);
            PerfDOM4J.xpath(doc “/*/*/Attr1x1“ 10);
            PerfDOM4J.xpath(doc “/*/*/Attr1x50“ 10);
            PerfDOM4J.xpath(doc “/*/*/Attr1x99“ 10);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x1“ 10);
            PerfDOM4J.xpathNodes(doc “/*/*/Attr1x50“ 10);
            PerfDOM4J.xpathNodes(doc “/*

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2005-05-16 14:28  dom4j-1.6.1\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\
     目录           0  2005-05-16 14:25  dom4j-1.6.1\docs\apidocs\org\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\bean\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\bean\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\datatype\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\datatype\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\dom\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\dom\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\dtd\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\dtd\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\io\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\io\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\jaxb\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\jaxb\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\rule\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\rule\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\rule\pattern\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\rule\pattern\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\swing\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\swing\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\tree\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\tree\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\util\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\util\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\xpath\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\xpath\class-use\
     目录           0  2005-05-16 14:28  dom4j-1.6.1\docs\apidocs\org\dom4j\xpp\
............此处省略1625个文件信息

评论

共有 条评论