How do we verify XML Elements in C#.Net
Xml sample:
<Employee>
<Name>Taha</Name>
<Age>25</Age>
</Employee>
If someone sent me the above example but by mistake he forgot to add ‘Age’ Element, then how would I verify it in C#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try with XSD in order to validate your xml
http://msdn.microsoft.com/en-us/library/astfyhd4%28v=vs.100%29
You have sample very interessant in this link
http://www.codeguru.com/csharp/csharp/cs_data/xml/article.php/c6737/Validation-of-XML-with-XSD.htm