Questions and answers when applying for a Java test (Part 6)
Source: Internet
Author: User
Xml
93. What parsing technologies does xml provide? What is the difference?
A: DOM, SAX, STAX, etc.
DOM: when processing large files, its performance drops sharply. This problem is caused by the DOM tree structure. This structure occupies a large amount of memory and the DOM must load the entire file into the memory before parsing the file. It is suitable for Random Access to the XML: unlike DOM, SAX is an event-driven XML parsing method. It reads XML files sequentially without loading the entire file at a time. When a file starts with a file, the document ends, or the tag starts with a tag, it triggers an event. You can write the processing code in the callback event to process the XML file, suitable for sequential access to XML
STAX: Streaming API for XML (StAX)
94. What aspects of xml technology have you used in your project? How to implement it?
A: data storage and information configuration are used. On the Data Exchange Platform, assemble data that cannot be used as data sources into XML files, compress and compress the XML files, compress the files, and encrypt the files, and send them to the receiver over the network, after receiving the decryption and decompression, restore the relevant information in the XML file for processing. XML can be easily used for software configuration. Various configuration parameters of the software are stored in XML files.
95. How many forms does the XML document define? What are the essential differences between them? How can I Parse XML documents?
A: two forms of dtd schema, B: essential difference: schema itself is xml and can be parsed by the XML Parser (this is also the fundamental purpose of developing the schema from the DTD ), c: DOM, SAX, STAX, etc.
DOM: when processing large files, its performance drops sharply. This problem is caused by the DOM tree structure. This structure occupies a large amount of memory and the DOM must load the entire file into the memory before parsing the file, which is suitable for Random Access to XML.
SAX: it does not exist in DOM. SAX is an event-driven XML parsing method. It reads XML files sequentially without loading the entire file at a time. When a file starts with a file, the document ends, or the tag starts with a tag, it triggers an event. You can write the processing code in the callback event to process the XML file, suitable for sequential access to XML
STAX: Streaming API for XML (StAX)
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service