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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Jan 3, 2011, 6:25 AM
If my post helped you please Mark As Answer !
Sam HobbsPosted Jan 3, 2011, 4:01 PM
Aisha IyerPosted Jan 3, 2011, 5:19 AM
http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/
and it worked for me. Thanks a lot :)
Posted Jan 3, 2011, 4:19 AM
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.
ShankeyPosted Jan 3, 2011, 4:03 AM
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;
}
}
}
}