Hi,
I have a huge XML file which is a collection of
P.S. The reason for looking for an alternate data structure is to get an improvement in performance. Is there a way I can get that improvement using string itself?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Jan 3, 2011, 1:25 AM EST
If my post helped you please Mark As Answer !
ShankeyRank #972 · 2.1K reputationPosted Jan 2, 2011, 11:03 PM EST
u can try something as shown below.
XmlReader _sReader = openXmlFile(filepath);
#region try
try
{ // loop continue till reaches end of file
while (!_sReader.EOF)
{ // check Node type,node name
if ((_xReader.MoveToContent() == XmlNodeType.Element) && _sReader.Name == "Filedocument")
{
XmlDocument doc = new XmlDocument();
// get node
XmlNode snode = doc.ReadNode(_sReader);
// play attribute
InitialiseSubNodes (snode);
}
else
{
_sReader.Read();
}
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
finally
{
_sReader.Close();
}
#endregion
public void InitialiseSubNodes(XmlNode node){
XmlNode snode;
XmlNodeList list = node.ChildNodes;
if (xnode.HasChildNodes)
{
for (int c = 0; c < list.Count; c++)
{
snode = node.ChildNodes[c];
string property = snode.LocalName;
switch (property)
{
case "sub nodes1":
break;
case "sub node2":
break;
default:
break;
}
}
}
}
Posted Jan 2, 2011, 11:19 PM EST
http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/
http://old.nabble.com/An-invalid-XML-character-(Unicode%3A-0x1c)-td14105005.html
Please try use to Linq to XML.
Aisha Iyer8 reputationPosted Jan 3, 2011, 12:19 AM EST
http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/
and it worked for me. Thanks a lot :)
Sam HobbsRank #107 · 20.5K reputationPosted Jan 3, 2011, 11:01 AM EST