Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Hi. actually I have an array with 500 size. then I have an XML file that contains 20 child nodes. Now, I want to compare the values saved in array to the child nodes in my XML file. I hope that the statements are more clearly stated for the viewers. :)
Posted
Updated 27-Nov-10 3:27am
v2

1 solution

Well, let me tell you that an XML file follows a schema i.e it ha a predefined format.

Your question is missing a lot of important information.
I will make few assumptions and try to answer it.

If the array is single dimension, you may create an XML file and create a node for each value. For later comparison, you can read value from each node, store it in temporary variable and do the comparison.
This method is fine if your array size is small but this is not a good idea if you have the number of elements in the array is too large.

I hope you understand what I mean.
I would like to suggest you to add more details about your scenario and the problem you are facing in your question by selecting 'Improve Question' below it. :thumbsup:
 
Share this answer
 
Comments
Tarun.K.S 27-Nov-10 4:47am    
Its a repost.yummy02 had asked this question here.http://www.codeproject.com/Answers/131157/array-and-xml-comparison-in-csharp.aspx#answer1
Ankur\m/ 27-Nov-10 4:50am    
Oh, I didn't see the other post. I didn't appear on the first page of my screen. :(
yummy02 27-Nov-10 9:30am    
yes, i repost it again. though Tarun's answer are so useful, I still want to find some ways but I still consider his answer, thanks Tarun. :)
Tarun.K.S 27-Nov-10 12:16pm    
No problem ankur! Thanks yummy!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900