Reading XML files with large amounts of data

Source: Internet
Author: User
When reading xml files with a large amount of data, although it supports XPath, it is easier to query, but you need to load them first, which wastes the memory and is relatively slow to use. If XMLReader is used, it does not need to be cached.

When reading xml files with a large amount of data, although it supports XPath, it is easier to query, but you need to load them first, which wastes the memory and is relatively slow to use. If XMLReader is used, it does not need to be cached and the reading speed is very fast. However, it is not convenient to query. XPath is not supported and only supports forward loops through the Reader () method. To avoid the disadvantages of the above two methods, come up with the following solution:
1. use XMLReader to read the content of the XML file to a linked list.
2. you can query the linked list during Query. (you can define the query function in the category of the linked list. you can directly call the function when you want to query it. this is very convenient ).
The results show that the speed and query results are good.

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.