I think maybe you should try XMLTextReader, simply like that
public static void ReadXML(out string ServerConnection, out string ConnectionTimeOut, out ArrayList Servers)
{
ServerConnection = "";
ConnectionTimeOut = "";
Servers = new ArrayList();
XmlTextReader reader = new XmlTextReader(@"D:\test.xm
while(reader.Read())
{
reader.MoveToElement();
if (reader.Name == "ServerConnection")
{
ServerConnection = reader.ReadInnerXml();
}
if (reader.Name == "ServerConnectionTimeOut")
{
ConnectionTimeOut = reader.ReadInnerXml();
}
if (reader.Name == "Server")
{
Servers.Add(reader.ReadInn
}
}
Main Topics
Browse All Topics





by: KelmenPosted on 2004-10-28 at 21:34:58ID: 12441327
XmlReader should be your pick.
As stated in the MSDN:
Represents a reader that provides fast, non-cached, forward-only access to XML data.
I would use the DOM if the xml and the data volume won't penalize the perf. And if the loaded xml will be reuse, DOM will give better throughput.
DOM - volume not huge, reuse
* Reuse = it will be used for process few/more times in one run
XmlReader - huge volume, 1 time process.