Reading problems of XML files with large data volumes
Updated: November 24, 2009 18:25:55 Author:
For xml files with large data volumes, although XPath is supported and query is more convenient, it needs to be loaded first, which wastes memory and is slow to use.
If you use XMLReader, you do not need to cache and read quickly, but it is not so convenient if you want to query. XPath is not supported and you can only loop forward through the Reader() method. In order to avoid the shortcomings of the above two methods, the following solutions are proposed:
1. First use XMLReader to read the contents of the XML file into a linked list.
2. Just query the linked list when querying (you can define the query function in the class that defines the linked list, and just call the function directly when querying, which is very convenient).
The result proves that the speed and query effect are very good.
1. First use XMLReader to read the contents of the XML file into a linked list.
2. Just query the linked list when querying (you can define the query function in the class that defines the linked list, and just call the function directly when querying, which is very convenient).
The result proves that the speed and query effect are very good.
Related Articles
2 small functions for reading and writing xml files
2 small functions for reading and writing xml files...2006-12-12An example of application of xml in powerbuilder(pb)
The data window in powerbuilder is really good. The work is basically done around it, which is very efficient. In the past few days, the project needs to use export xml files, so I used pb9 (the xml export and import function is a function added from powerbuilder9.0) to verify the feasibility.2009-06-06Coding issues in the XSLT process on the server side
Coding issues in the XSLT process on the server side...2007-02-02Introduction to xpath_System for Dynamic Node Java Academy
xpath is the method of selecting nodes in XML files. Next, through this article, share with you the relevant knowledge about xpath. Interested friends can learn together2017-08-08Asp reads xml files and counts
Asp reads xml files and counts...2006-11-11Solution to UTF8 to GB2312 garbled code problem
The reviewed information must generate XML-type files, and the XML must be encoded by GB2312, because many websites collected using UTF8 encoding, which will appear garbled in the process of conversion.2013-04-04Meteorological XML Data Source Application Development Guide - Operation Checklist
Meteorological XML Data Source Application Development Guide - Operation Checklist...2007-02-02Use XSL to output CDATA annotations in XML documents as HTML text
Use XSL to output CDATA annotations in XML documents as HTML text...2006-09-09In-depth understanding of XML entity injection
This article mainly introduces you to inject in-depth understanding of XML entities. Friends in need can learn from it for reference. I hope it can be helpful. I wish you more progress and get a promotion as soon as possible.2022-10-10Code to parse xml into xhtml using xslt
The basic format of xslt parsing code shown below. Friends who need it can refer to it2009-11-11