Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
1.00/5 (1 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
thanks
Posted
Comments
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
<alltable>
<tbl_filtered_mobiles_table>
<tbl_filtered_mobiles>
<id>100
<mobile>01235666666
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
<id>1
<mobile>012589635875
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
<id>47
<mobile>011259863255
</tbl_filtered_mobiles>
<tbl_filtered_mobiles>
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.
—SA

1 solution

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.
 
Share this answer
 

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