August 2003
Beginner to intermediate
600 pages
12h 57m
English
Many times when reading an XML stream, you find that you are searching for one particular node or parent node in the document that meets a certain criterion. The XmlTextReader does not provide any methods that will allow you to find one particular node quickly. Therefore, searching an XML stream with the XmlTextReader can be both complicated and processor intensive. These issues can be alleviated if you design your XML data carefully. Listing 10.19 illustrates how to build a method that will search for a given error message in an XML document with the Skip method.
C# public string FindErrorMessage(string filename, int catNumber, int errorNumber) { XmlTextReader reader = new XmlTextReader(filename); reader.WhitespaceHandling ... |
Read now
Unlock full access