Click here to Skip to main content
11,631,906 members (49,790 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
hello all
kindly,can any one help me in this
i have function that that take two parameter string ,xmlpath

1-string contains alot of mobiles that separated with comma
2-xml file containt on mobile
i want to compare between this string and xml file and get the common

what the best way to get difference between them
thanks
Posted 26-Jan-13 4:23am
Comments
PIEBALDconsult at 26-Jan-13 11:02am
   
Can you show a snippet of the XML? How long is the string to search?
sarsoraa at 26-Jan-13 11:18am
   
string may be containt 1 mobile or 100000 mobile
and xml snippet

<tbl_filtered_mobiles_table>
<tbl_filtered_mobiles>
100
01235666666
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
1
012589635875
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
47
011259863255
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
PIEBALDconsult at 26-Jan-13 12:04pm
   
Shouldn't be too bad then.
Learn some XPath.
Load the XML into an XmlDocument and use SelectNodes, foreach the results.
Then either use .IndexOf (or similar) to see if the value is in the string..
or (preferred) Split the string up into a HashSet and see if the value is in the set.
Sergey Alexandrovich Kryukov at 26-Jan-13 11:53am
   
Not a question. Define "difference" formally; this will be the hardest point, and the rest won't be a problem.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi

You can Serialize your input string to XML after that if it has error therefore your string is not XML format and if it doesn't have error therefore your string is XML format.

If you have need to more detail please tell me.

I hope it's helpful for you.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,397
1 Sergey Alexandrovich Kryukov 8,009
2 Mika Wendelius 6,260
3 F-ES Sitecore 2,296
4 Suvendu Shekhar Giri 1,970


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100