How can I efficiently get XML node from large XML file?
Currently I have this code to load XML file and getting NodeList. This worked fine when that file was small (containing only that node). However, when I merged it with another XML file, Loading that new entire file cases my Windows Mobile device to crash (out of memory)
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(configFile);
XmlNodeList nodeList = xmlDocument.GetElementsByTagName("appsettings");
My XML is looks like this (I want to get appsettings
which controls visibility of buttons in my app):
<site>
<settings>
<appsettings>
<add key="0" type="Home" value="True"/>
<add key="1" type="About" value="False"/>
<add key="2" type="Contact" value="True"/>
</appsettings>
...........
</settings>
</site>
How can I search for this node with XmlReader and load it into nodeList
?
I have tried to use