Click here to Skip to main content
13,047,502 members (59,641 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Posted 26-Jan-13 4:23am
PIEBALDconsult 26-Jan-13 11:02am
Can you show a snippet of the XML? How long is the string to search?
sarsoraa 26-Jan-13 11:18am
string may be containt 1 mobile or 100000 mobile
and xml snippet
PIEBALDconsult 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 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.

1 solution

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

Solution 1


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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2017
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