The XML file is a tree structure.
The basic components are nodes, node attributes, node values, and document declarations.
XML is used to store data in a tree format.
For data operations, add, delete, query, and modify data.
That is, a specific function is bound to add, query, modify, and delete nodes, node attributes, and node values in the XML file. Different languages correspond to different function names.
However, no matter which aspect of addition, deletion and modification, the first step is to find the node, or node attribute, or node value. That is to say, the first step is to query.
You can query this operation in two ways.
A is similar to datareader. It only reads forward data. The memory does not store historical data and only reads the current data.
B is similar to dataset. It reads the entire XML document and stores it in memory.
A and B are not both superior and inferior, but the price/performance ratio is different in different occasions. However, a is more secure and can be used more. That is to say, in any scenario, if you do not want to choose, you have to use a general purpose, so you can use the solution.
The search algorithm has an important impact on the speed of this operation. In most cases, non-algorithm engineers do not have to consider this. Because the algorithm engineer has encapsulated it for you.
This is the irresponsible C # operation XML analysis.