Dom parsing and sax parsing, dom parsing and sax ParsingThere are four ways to parse xml: DOM, SAX, DOM4j, and JDOM.We mainly learned two types: DOM and SAX.DOM is suitable for parsing relatively simple XML, while SAX is suitable for parsing more complex XML files. Each has its own merits.Differences Between DOM and
The Windows version of PHP from version 5.2.1 started with the thread safe (thread safe) and none thread safe (NTS, non-thread-safe) of the points, the difference is where? Which one should I use? Here is a simple introduction.The first Windows version of PHP3.0.17, released on October 20, 2000, started with a thread-
Java API for XML Processing (JAXP) allows you to use several different APIs to verify, parse, and convert XML. JAXP provides both ease of use and developer neutrality. This series introduces JAXP, which consists of two parts. This article is the first part to show you how to use API resolution and verification features. The second section describes how to use JAXP for XSL conversion.
Java and XML are undoubtedly the most important programming and development tools in the past five years.
The Windows version of PHP from version 5.2.1 started with the thread safe (thread safe) and none thread safe (NTS, non-thread-safe) of the points, the difference is where? Which one should I use? Here is a simple introduction. The first Windows version of PHP3.0.17, released on October 20, 2000, started with a thre
Windows version of PHP starts with thread safe (thread safety) and none thread safe (NTS, non-5.2.1) from versionThread-safe), the difference between the two is where. What kind of it should be used. Here's a simple introduction.The first Windows version of PHP3.0.17, released from October 20, 2000, starts with a thread-safe
Why do they exist at the same time?
What is Dom?
What is sax?
When to use dom
When to use SAX
Conclusion
Why do they exist at the same time?
--------------------------------------------------------------------------------
SAX (Simple API for XML) and Dom (Document Object Model) are designed to allow programmers to access their information without having to write
Java parses XML in two ways: Dom and sax. Although Dom is W3C standard and provides a standard parsing method, its parsing efficiency has been unsatisfactory because when using Dom to parse XML, the parser reads the entire document and constructs a tree (node tree) with resident memory. Then, your code can use the standard DOM interface to operate the tree. However, in most cases, we are only interested in part of the content of the document, so we do
Why do they exist at the same time?
--------------------------------------------------------------------------------
SAX (Simple API for XML) and Dom (Document Object Model) are designed to allow programmers to access their information without having to write a parser. By saving information in XML 1.0 format and using sax or DOM APIs, your program can use any parser. This is because developers who use their
Source: IBM Tutorial Download
SAX is what.
The standard used to read and manipulate XML files is the Document Object model (Doc object model,dom). Unfortunately, the DOM method involves reading the entire file and storing the file in a tree structure, which can be inefficient, slow, and resource-intensive.
An alternative technique is simple APIs for XML, or SAX.
The previous article mentioned how to use Dom to parse and operate XML in Java. This article explains how to use SAX to parse and operate XML in Java, which is a little clear on the mobile platform, the XML-based event mechanism can save a lot of memory.
----- Text -----Source: http://www0.ccidnet.com/tech/guide/2001/10/08/58_3392.html
Sax concepts
Sax is the abb
Xml| Programming Sax Concept
Sax is the abbreviation of simple API for XML, it is not the standard that is put forward by the official of the consortium, it can be said as the "folk" fact standard. In fact, it is a community-nature discussion product. Even so, the application of Sax in XML is no less than DOM, and almost all XML parsers will support it.
First, we will introduce the basic knowledge of sax, Dom, JAXP, JDOM, and dom4j:(Note: For JAXP | jaxb | jaxm | jaxr | what the JAX-RPC is, view the http://gceclub.sun.com.cn/staticcontent/html/xml/faq/#jaxr)
1. Sax and Dom are two methods for analyzing XML documents (no specific implementation, only interfaces)So it's not an interpreter. If you have them alone, you cannot process the XML document.The
Sax is an XML parser that is fast and consumes less memory, and is ideal for mobile devices such as Android. The Sax parsing XML file takes event-driven, that is, it does not need to parse through the entire document, and in the process of parsing the document in content order, sax determines whether the currently-read character is legitimate in the XML syntax, a
1 DOM (JAXP Crimson Parser)
DOM is the official consortium standard for representing XML documents in a platform-and language-independent way. A DOM is a collection of nodes or pieces of information organized in a hierarchical structure. This hierarchy allows developers to find specific information in the tree. Parsing the structure usually requires loading the entire document and the construction hierarchy before any work can be done. Because it is based on the information hierarchy, the DOM i
in a tag.. ATTR inherits from node, but because ATTR is actually contained in element, it cannot be considered as a sub-object of element, so ATTR is not part of the DOM tree in Dom, therefore, the returned values of getparentnode (), getpreviussibling (), and getnextsibling () in node are null. That is to say, ATTR is actually regarded as part of its element object, and does not appear as a separate node in the DOM tree. This should be different from other node sub-objects in use.
-------------------------------------Sax Parsing XML----------------------------------"Sax definitionSax is a fast parsing and memory-intensive XML parser, ideal for mobile devices such as AndroidThe Sax full name is simple API for Xml, which refers to both an interface and a packageAs an interface, sax is a standard i
In Android development, often used to parse XML files, the common way to parse XML is three kinds: SAX, Pull, Dom parsing method. Recently made an Android version of the CSDN reader, using two of these (sax,pull), this article on the Android parsing XML three ways to make a summary.
The XML sample parsed today (Channels.xml) is as follows:
First, use Sax
Sax
When parsing an XML document, the SAX parser triggers a series of events that the application accesses to the XML document through the event handler function.
Because event firings are sequential, the SAX parser provides a sequential access mechanism to XML documents, and for the parts that have been analyzed,
You can't go back and do it again. In additio
It Programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary. Sax Parsing
1. When parsing an XML document using the DOM, the entire XML document needs to be read, the Doucment object representing the entire DOM tree is architected in memory, and the XML document is then manipulated. In this case, if the XML document is particularly large, it consumes a large amount of memory
Turn from: http://blog.csdn.net/seu_calvin/article/details/52027484
1. DOM (document object model)(1) Dom is a set of specifications specified by the consortium, the core of the DOM is to process the data by the tree structure, the DOM parser reads the XML file and constructs an identical tree in memory, can specify the element to be accessed, random access, modify the XML file arbitrarily. In particular, it is very easy to process forward.
(2) DOM is based on memory, regardless of the size of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.