DOM, SAX, JDOM, DOM4J advantages and disadvantages and production xml and parse xml

Download the necessary jar package:

activation.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
jaxen-1.1.1.jar
jdom-1.0.jar

A, DOM

The parser reads the entire document, and then build a tree structure of memory resident, the interface used to manipulate the DOM tree structure.

advantages: the entire document tree in memory, easy to operate; support delete, modify, rearrange other functions; high access efficiency.

disadvantages: the entire document into memory (including unnecessary nodes), waste of time and space; Use: Once parsed document needs a plurality of times to access the data; sufficient hardware resources (memory , CPU)

 
  1. package xmlParse;  
  2.   
  3. import java.io.File;  
  4. import java.io.FileNotFoundException;  
  5. import java.io.FileOutputStream;  
  6. import java.io.IOException;  
  7. import java.util.Calendar;  
  8. import java.util.Locale;  
  9. import java.util.TimeZone;  
  10.   
  11. import javax.xml.parsers.DocumentBuilder;  
  12. import javax.xml.parsers.DocumentBuilderFactory;  
  13. import javax.xml.parsers.ParserConfigurationException;  
  14. import javax.xml.parsers.SAXParser;  
  15. import javax.xml.parsers.SAXParserFactory;  
  16. import javax.xml.transform.Result;  
  17. import javax.xml.transform.Transformer;  
  18. import javax.xml.transform.TransformerConfigurationException;  
  19. import javax.xml.transform.TransformerException;  
  20. import javax.xml.transform.TransformerFactory;  
  21. import javax.xml.transform.dom.DOMSource;  
  22. import javax.xml.transform.stream.StreamResult;  
  23.   
  24. import org.w3c.dom.DOMException;  
  25. import org.w3c.dom.Document;  
  26. import org.w3c.dom.Element;  
  27. import org.w3c.dom.Node;  
  28. import org.w3c.dom.NodeList;  
  29. import org.xml.sax.SAXException;  
  30.   
  31. /** 
  32. * Java comes dom analytic xml file
  33.  *  
  34.  * @author abc 
  35.  *  
  36.  */  
  37. public class TestDom {  
  38.     public static void main(String[] args) {  
  39.         builXmlByDom();  
  40.         parseXmlByDom();  
  41.     }  
  42.     /** 
  43. * Generate xml information
  44.      */  
  45.     public static void builXmlByDom() {  
  46.         long begintime = System.currentTimeMillis();  
  47.         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();  
  48.         try {  
  49.             // build Document
  50.             DocumentBuilder db = dbf.newDocumentBuilder();  
  51.             Document doc=db.newDocument();  
  52.             Element root=doc.createElement("students");  
  53.             root.setAttribute("class", "Class");
  54.             root.setAttribute("count", "3");  
  55.               
  56.             Element stu=doc.createElement("student");  
  57.             Element name=doc.createElement("name");  
  58.             name.appendChild(doc.createTextNode("Xiao Ming"));
  59.             Element age=doc.createElement("age");  
  60.             age.appendChild(doc.createTextNode("10"));  
  61.             stu.appendChild(name);  
  62.             stu.appendChild(age);  
  63.             root.appendChild(stu);  
  64.               
  65.               
  66.              stu=doc.createElement("student");  
  67.              stu.setAttribute("position","Squad leader");
  68.              name=doc.createElement("name");  
  69.              name.appendChild(doc.createTextNode("Wang"));
  70.              age=doc.createElement("age");  
  71.              age.appendChild(doc.createTextNode("11"));  
  72.              stu.appendChild(name);  
  73.              stu.appendChild(age);  
  74.              root.appendChild(stu);  
  75.   
  76.              stu=doc.createElement("student");  
  77.              name=doc.createElement("name");  
  78.              name.appendChild(doc.createTextNode("Soldier"));
  79.              age=doc.createElement("age");  
  80.              age.appendChild(doc.createTextNode("12"));  
  81.              stu.appendChild(name);  
  82.              stu.appendChild(age);  
  83.              root.appendChild(stu);  
  84.                
  85.              doc.appendChild(root);  
  86.              @ Document object will be converted to a packaged object DOMSource
  87.              DOMSource xmlSource=new DOMSource(doc);  
  88.              // use the Transformer object to a Document node is converted to an XML file
  89.              TransformerFactory transFactory=TransformerFactory. newInstance();  
  90.              Transformer transformer=transFactory.newTransformer();  
  91.                
  92.              // Create Result
  93.              File file=new File("students.xml");  
  94.              FileOutputStream fos;  
  95.              fos = new FileOutputStream(file);  
  96.              StreamResult result=new StreamResult(fos);  
  97.              transformer.transform(xmlSource, result);  
  98.              if(fos!=null){  
  99.                  fos.close();  
  100.              }  
  101.         }catch (ParserConfigurationException e) {  
  102.             e.printStackTrace();  
  103.         }catch (TransformerConfigurationException e) {  
  104.             e.printStackTrace();  
  105.         }catch (FileNotFoundException e) {  
  106.             e.printStackTrace();  
  107.         }catch (TransformerException e) {  
  108.             e.printStackTrace();  
  109.         }catch (IOException e) {  
  110.             e.printStackTrace();  
  111.         }    
  112.         System.out.println("DOM generation time (ms)"
  113.                 + (System.currentTimeMillis() - begintime));  
  114.     }  
  115.     /** 
  116. * Parse xml information
  117.      */  
  118.     public static void parseXmlByDom() {  
  119.         long begintime = System.currentTimeMillis();;  
  120.         try {  
  121.             DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();  
  122.             DocumentBuilder builder=dbf.newDocumentBuilder();  
  123.             File file=new File("students.xml");  
  124.             Document doc=builder.parse(file);  
  125.             NodeList students=doc.getFirstChild().getChildNodes();  
  126.             Node student=null;  
  127.             Node node=null;  
  128.             for(int i=0,len=students.getLength();i<len;i++){  
  129.                 student=students.item(i);  
  130.                 NodeList childs=student.getChildNodes();  
  131.                 System.out.println("Section" + (i +1)+"Students");
  132.                 for(int j=0,size=childs.getLength();j<size;j++){  
  133.                     node=childs.item(j);  
  134.                     if("name".equals(node.getNodeName())){  
  135.                         System.out.println(node.getNodeName()+"---"+node.getTextContent());  
  136.                     }  
  137.                     if("age".equals(node.getNodeName())){  
  138.                         System.out.println(node.getNodeName()+"---"+node.getTextContent());  
  139.                     }  
  140.                 }  
  141.             }  
  142.         } catch (DOMException e) {  
  143.             e.printStackTrace();  
  144.         } catch (ParserConfigurationException e) {  
  145.             e.printStackTrace();  
  146.         } catch (SAXException e) {  
  147.             e.printStackTrace();  
  148.         } catch (IOException e) {  
  149.             e.printStackTrace();  
  150.         }  
  151.         System.out.println("DOM resolution time (ms)"
  152.                 + (System.currentTimeMillis() - begintime));  
  153.     }  
  154. }  


two, SAX

Features: 1, while being read resolution, used in large XML documents

2, only support read

3, low access efficiency

4, sequential access

[java] view plain copy
  1. package xmlParse;  
  2.   
  3. import java.io.File;  
  4.   
  5. import javax.xml.parsers.SAXParser;  
  6. import javax.xml.parsers.SAXParserFactory;  
  7.   
  8. public class TestSAXParse {  
  9.   
  10.     /** 
  11.      * @param args 
  12.      */  
  13.     public static void main(String[] args) {  
  14.         sax();  
  15.     }  
  16.   
  17.     public static void sax() {  
  18.         long begintime = System.currentTimeMillis();  
  19.         File f = new File("students.xml");  
  20.         SAXParserFactory sf = SAXParserFactory.newInstance();  
  21.         try {  
  22.             SAXParser sp = sf.newSAXParser();  
  23.             SAXHandler handler = new SAXHandler();  
  24.             sp.parse(f, handler);  
  25.         } catch (Exception e) {  
  26.             e.printStackTrace();  
  27.         }  
  28.         System.out.println("SAX resolution time (ms)"
  29.                 + (System.currentTimeMillis() - begintime));  
  30.   
  31.     }  
  32. }  
  33.   
  34.   
  35.   
  36. SAXHandler.java  
  37. package xmlParse;  
  38.   
  39. import org.xml.sax.Attributes;  
  40. import org.xml.sax.SAXException;  
  41. import org.xml.sax.helpers.DefaultHandler;  
  42. import java.util.Stack;  
  43. public class SAXHandler extends DefaultHandler {  
  44.     Stack tags = null;  
  45.     @Override  
  46.     public void startDocument() throws SAXException {  
  47.         tags=new Stack();  
  48.     }  
  49.   
  50.     @Override  
  51.     public void endDocument() throws SAXException {  
  52.         while(!tags.isEmpty()){  
  53.             System.out.println(tags.peek());  
  54.             tags.pop();  
  55.         }  
  56.         tags=null;  
  57.     }  
  58.   
  59.     @Override  
  60.     public void startElement(String uri, String localName, String qName,  
  61.             Attributes attributes) throws SAXException {  
  62.         if("students".equals(qName)){  
  63.             System.out.println(attributes.getValue("class")+"- number -" + attributes.getValue ("count"));  
  64.         }  
  65.         tags.push(qName);// pushed onto the stack
  66.     }  
  67.   
  68.     @Override  
  69.     public void endElement(String uri, String localName, String qName)  
  70.             throws SAXException {  
  71.         tags.pop();// Remove the top element
  72.     }  
  73.   
  74.     @Override  
  75.     public void characters(char[] ch, int start, int length)  
  76.             throws SAXException {  
  77.         String tag=(String) tags.peek();// Check the top element, but does not remove
  78.         if("name".equals(tag)){  
  79.             System.out.println("name==="+new String(ch,start,length));  
  80.         }  
  81.         if("age".equals(tag)){  
  82.             System.out.println("age==="+new String(ch,start,length));  
  83.         }  
  84.     }  
  85.   
  86. }  


Three, JDOM

JDOM
advantages: ① is a tree-based XML processingJavaAPI, the tree is loaded in memory
② not limited backward compatible, so a simple ratio DOM
③ speed, fewer defects
④ having a SAXJavarule
disadvantages: ① document is larger than the memory can not handle
②JDOM logic model representation of XML documents. No guarantee that every byte real transformation.
③ for instance document does not provide any DTD model and the actual model.
④ DOM does not support a respective packet traversing
is best suited for: JDOM conveniently having a tree, there are rules of SAX JAVA. Used when necessary balance


[java] view plain copy
  1. JDOM  
  2.   
  3.   
  4. package xmlParse;  
  5.   
  6. import java.io.ByteArrayOutputStream;  
  7. import java.io.File;  
  8. import java.io.FileInputStream;  
  9. import java.io.FileNotFoundException;  
  10. import java.io.FileOutputStream;  
  11. import java.io.IOException;  
  12. import java.util.List;  
  13.   
  14. import org.jdom.Document;  
  15. import org.jdom.Element;  
  16. import org.jdom.JDOMException;  
  17. import org.jdom.input.SAXBuilder;  
  18. import org.jdom.output.XMLOutputter;  
  19.   
  20. public class TestJDOM {  
  21.   
  22.     /** 
  23.      * @param args 
  24.      */  
  25.     public static void main(String[] args) {  
  26.         buildXmlByJDOM();  
  27.         parseXmlByJDOM();  
  28.     }  
  29.       
  30.     public static String buildXmlByJDOM(){  
  31.         Document doc=new Document();  
  32.         Element root=new Element("students");  
  33.         root.setAttribute("count", "3");  
  34.         root.setAttribute("class", "Class");
  35.         doc.setRootElement(root);  
  36.         root.addContent(new Element("student").addContent(new Element("name").setText("Xiao Ming"))
  37.                 .addContent(new Element("age").setText("10")));  
  38.         root.addContent(new Element("student").addContent(new Element("name").setText("Xiao Wang"))
  39.                 .addContent(new Element("age").setText("11")));  
  40.         root.addContent(new Element("student").addContent(new Element("name").setText("Soldier"))
  41.                 .addContent(new Element("age").setText("12")));  
  42.         ByteArrayOutputStream out=new ByteArrayOutputStream();  
  43.         XMLOutputter putter=new XMLOutputter();  
  44.         try {  
  45.             putter.output(doc, out);  
  46.             putter.output(doc, new FileOutputStream("students.xml"));  
  47.         } catch (FileNotFoundException e) {  
  48.             e.printStackTrace();  
  49.         } catch (IOException e) {  
  50.             e.printStackTrace();  
  51.         }  
  52.         return out.toString();  
  53.     }  
  54.    public static void parseXmlByJDOM(){  
  55.        long begintime=System.currentTimeMillis();  
  56.        File f=new File("students.xml");    
  57.        SAXBuilder builder=new SAXBuilder();  
  58.        try {  
  59.         Document doc=builder.build(new FileInputStream(f));  
  60.         Element root=doc.getRootElement();  
  61.         System.out.println(root.getAttributeValue("class")+"- Number: -" + root.getAttributeValue ("count"));  
  62.           
  63.         List list=root.getChildren("student");  
  64.         for(int i=0;i<list.size();i++){  
  65.             Element ele=(Element)list.get(i);  
  66.             System.out.println("Section" + (i +1)+"Students");
  67.             System.out.println(ele.getChildText("name")+"---"+ele.getChildText("age"));  
  68.         }  
  69.         } catch (FileNotFoundException e) {  
  70.             e.printStackTrace();  
  71.         } catch (JDOMException e) {  
  72.             e.printStackTrace();  
  73.         } catch (IOException e) {  
  74.             e.printStackTrace();  
  75.         }  
  76.         System.out.println("Sax resolution time (ms)" + (System.currentTimeMillis () - begintime));
  77.    }  
  78. }  


four, DOM4J

DOM4J is a very, very goodjavaXML API, with excellent performance, powerful and extremely easy-to-use features, it is also a software open source. Now you can see more and more Java software are in use DOM4J to read and write XML, is particularly worth mentioning is that even the Sun is also used JAXM DOM4J.

 

    DOM4J  
    package xmlParse;  
      
    import java.io.File;  
    import java.io.FileInputStream;  
    import java.io.FileNotFoundException;  
    import java.io.FileWriter;  
    import java.io.IOException;  
    import java.io.UnsupportedEncodingException;  
    import java.util.Iterator;  
    import java.util.List;  
      
    import org.dom4j.Document;  
    import org.dom4j.DocumentException;  
    import org.dom4j.DocumentHelper;  
    import org.dom4j.Element;  
    import org.dom4j.Node;  
    import org.dom4j.io.OutputFormat;  
    import org.dom4j.io.SAXReader;  
    import org.dom4j.io.XMLWriter;  
      
    public class TestDom4J {  
      
        /** 
         * @param args 
         */  
        public static void main(String[] args) {  
            buildXmlByDOM4J();  
            paserXmlByDOM4J();  
        }  
        public static void buildXmlByDOM4J(){  
            Document doc=DocumentHelper.createDocument();  
            doc.setXMLEncoding("UTF-8");  
            Element root=doc.addElement("students");  
            root.addAttribute ( "class", "class") .addAttribute ( "count", "3");  
            Element student=root.addElement("student");  
                         student.addElement ( "name") setText ( "Bob");  
            student.addElement("age").setText("10");  
              
                         student = root.addElement ( "student") addAttribute ( "position", "monitor");  
                         . Student.addElement ( "name") setText ( "Nanxiaowang");  
            student.addElement("age").setText("11");  
          
            student=root.addElement("student");  
                         . Student.addElement ( "name") setText ( "soldier");  
            student.addElement("age").setText("12");  
              
            String xmlStr=doc.asXML();  
            try {  
                OutputFormat format=OutputFormat.createPrettyPrint();  
                XMLWriter writer=new XMLWriter(new FileWriter(new File("students.xml")),format);  
                writer.setEscapeText(false);  
                writer.write(xmlStr);  
                writer.close();  
            } catch (UnsupportedEncodingException e) {  
                e.printStackTrace();  
            } catch (FileNotFoundException e) {  
                e.printStackTrace();  
            }catch (IOException e) {  
                e.printStackTrace();  
            }  
        }  
        public static void paserXmlByDOM4J(){  
              long begintime=System.currentTimeMillis();  
              SAXReader reader=new SAXReader();  
              try {  
                Document doc=reader.read(new FileInputStream(new File("students.xml")));  
                Element root=doc.getRootElement();  
                                 System.out.println (root.attributeValue ( "class") + "- number -" + root.attributeValue ( "count"));  
                 / * List <Node> list = root.selectNodes ( "student"); // needs to be introduced jaxen-1.1.1.jar 
                for(int i=0,len=list.size();i<len;i++){ 
                    Node node=(Node)list.get(i); 
                    System.out.println(node.selectSingleNode("name").getText()+"---"+node.selectSingleNode("age").getStringValue()); 
                }*/  
                Iterator it=root.elementIterator();  
                Element ele;  
                while(it.hasNext()){  
                    ele=(Element)it.next();  
                    //System.out.println(ele.selectSingleNode("name").getText()+"---"+ele.selectSingleNode("age").getText());  
                    System.out.println(ele.elementText("name")+"---"+ele.elementText("age"));  
                }  
              } catch (FileNotFoundException e) {  
                e.printStackTrace();  
            } catch (DocumentException e) {  
                e.printStackTrace();  
            }  
                
                             System.out.println ( "sax resolution time (ms)" + (System.currentTimeMillis () - begintime));  
        }  
    }  

dom4 parse xml case of another code:

    package com.java.team;  
      
    import java.io.File;  
    import java.util.ArrayList;  
    import java.util.Iterator;  
    import java.util.List;  
      
    import org.dom4j.Document;  
    import org.dom4j.DocumentException;  
    import org.dom4j.Element;  
    import org.dom4j.io.SAXReader;  
      
    public class ParseXml {  
        public void read() throws Exception {  
            SAXReader reader = new SAXReader();  
            Document document = reader.read(new File("src/test.xml"));  
            Element root = document.getRootElement();  
                         // under the resourceitem resolved out of allresource on the list in  
            List list  = root.elements("resourceitem");  
                         // Create a source storage resources in each resourceitem  
            List<XmlBean> source = new ArrayList<XmlBean>();  
                         // will parse out the resourceitem in, stored in the source by XmlBean  
            for(Iterator i = list.iterator();i.hasNext();) {  
                Element resourceitem = (Element) i.next();  
                String id = resourceitem.element("id").getText();  
                String title = resourceitem.element("title").getText();  
                String keywords = resourceitem.element("keywords").getText();  
                String kind = resourceitem.element("kind").getText();  
                String describe = resourceitem.element("describe").getText();  
                String date = resourceitem.element("date").getText();  
                String url = resourceitem.element("url").getText();  
                String author = resourceitem.element("author").getText();  
                String publisher = resourceitem.element("publisher").getText();  
                XmlBean bean = new XmlBean();  
                bean.setId(id);  
                bean.setTitle(title);  
                bean.setKeywords(keywords);  
                bean.setKind(kind);  
                bean.setDescribe(describe);  
                bean.setDate(date);  
                bean.setUrl(url);  
                bean.setAuthor(author);  
                bean.setPublisher(publisher);  
                source.add(bean);  
            }  
         
        }  
      
    }  


 
 XmlBean classes are as follows:
[java] view plain copy

    package com.java.team;  
      
    public class XmlBean {  
        private String id;  
        private String title;  
        private String keywords;  
        private String kind;  
        private String describe;  
        private String date;  
        private String url;  
        private String author;  
        public String getKeywords() {  
            return keywords;  
        }  
      
        public void setKeywords(String keywords) {  
            this.keywords = keywords;  
        }  
      
        public String getKind() {  
            return kind;  
        }  
      
        public void setKind(String kind) {  
            this.kind = kind;  
        }  
      
        public String getDescribe() {  
            return describe;  
        }  
      
        public void setDescribe(String describe) {  
            this.describe = describe;  
        }  
      
        public String getDate() {  
            return date;  
        }  
      
        public void setDate(String date) {  
            this.date = date;  
        }  
      
        public String getUrl() {  
            return url;  
        }  
      
        public void setUrl(String url) {  
            this.url = url;  
        }  
      
        public String getAuthor() {  
            return author;  
        }  
      
        public void setAuthor(String author) {  
            this.author = author;  
        }  
      
        public String getPublisher() {  
            return publisher;  
        }  
      
        public void setPublisher(String publisher) {  
            this.publisher = publisher;  
        }  
      
        private String publisher;  
      
        public String getId() {  
            return id;  
        }  
      
        public void setId(String id) {  
            this.id = id;  
        }  
      
        public String getTitle() {  
            return title;  
        }  
      
        public void setTitle(String title) {  
            this.title = title;  
        }  
      
    }  

 xml file are the following:
[html] view plain copy

    <?xml version="1.0" encoding="UTF-8"?>  
      
    <allresource host="192.168.16.111" remote="192.168.16.111">   
      <resourcenum>499</resourcenum>    
      <resourceitem>   
        <id>2</id>    
                 <Title> "real" Review d.doc </ title>    
                 <Keywords> real review, the review period </ keywords>    
        <kind>doc</kind>    
                 <Describe> period of refresher training title </ describe>    
        <date>2008-6-18 20:50:01</date>    
                 <Url> http://192.168.16.111:8080/resources/ "real" Review d.doc </ url>    
                 <Author> Hu Kelin </ author>    
                 <Publisher> licheng in two </ publisher>   
      </resourceitem>    
      <resourceitem>   
        <id>3</id>    
                 <Title> "axis of symmetry" Teaching Design </ title>    
                 <Keywords> axis of symmetry, the plane geometry </ keywords>    
        <kind>doc</kind>    
                 <Describe> recognize symmetry axis, know the meaning of the axis of symmetry, it is possible to find the axis of symmetry of the axis of symmetry </ describe>    
        <date>2008-6-18 20:55:10</date>    
                 <Url> http://192.168.16.111:8080/resources/ "axis of symmetry" instructional design .doc </ url>    
                 <Author> Hu Kelin </ author>    
                 <Publisher> licheng in two </ publisher>   
      </resourceitem>    

 

Intelligent Recommendation

Comparison of XML methods DOM, SAX, DOM4J, JDOM, StAX

Detailed explanation and comparison of JAM parsing XML methods DOM, SAX, DOM4J, JDOM, StAX 1. Detailed explanation of various ways 1) DOM (JAXP Crimson parser) DOM is the official W3C standard for rep...

Java parsing xml -- DOM4J JDOM DOM SAX comparison

2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> DOM4J http://dom4j.sourceforge.net Although DOM4J represents a completely independent development result, init...

Detailed --DOM parsing XML parsing, SAX, DOM4J, JDOM

  Four kinds of analytical methods: DOMResolution,SAXResolution,DOM4JResolution,JDOMParsing (Which when parsing DOM and SAX parsing official java parse xml document to us the way, so we do not ne...

Java XML parsing methods (DOM, SAX, JDOM, DOM4J)

Java XML parsing method 1. Introduction to XML 2. XML parsing 2.1 DOM analysis 2.2 SAX analysis 2.3 JDOM analysis 2.4 DOM4J analysis 1. Introduction to XML XML Value Extensible Markup Language is used...

XML: four parsers (dom, sax, jdom, dom4j) principle and performance comparison

Reprinted from: http://blog.csdn.net/sunhuaqiang1/article/details/54984745 dom is one of the underlying interfaces for parsing xml (the other is sax). Jdom and dom4j are more advanced packages based o...

More Recommendation

xml - 4 kinds of parsing methods dom, sax, jdom, dom4j

dom analysis Take the following xml as an example SAX analysis jDOM First get the root node, then get the collection of child nodes, traverse the attributes of the child nodes and the child nodes of t...

Java parses XML four ways: SAX, DOM, DOM4J, JDOM

This article mainly introduces four mainstream Java parsing XML files, for reference only, this article is based on the books.xml file content: SAX analysis XML 1.1 SAXParserHandler.java 1.2 Test clas...

XML,DOM ,SAX ,DOM4J

XML 、 、 、 1.1 XMl? , , , 。( ) 1.2 xml readability xml , XML , xml xml , xml “ ”。 xml xml , 2 XML HTML XML HTML 3. XML 3.1 XMl , 3.2 : XML , , 。 XML 、 XML : , Case Sensitive XML 3.3 XML , 。...

XML--jdom/dom4j/sax parsing XML files

XML 1. XML (extensible markup language): Extensible markup language. 2. The characteristic of XML is that tags can be extended by users themselves. For example, how to write tags in html, how to write...

DOM, JDOM, DOM4J parsing XML

DOM, JDOM, DOM4J parsing XML Java parsing XML usually has two ways,DOMwithSAX(SAX has been demonstrated) DOM: Document Object Model (Document Object Model) DOM features: Define a set of Java interface...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top