I need to validate a selected Xml file using Xdocument without Xsd. I have a file named "Cheker" and the file to check. for example i need to compare the hierarchy ,and how much elements by name from the checker file. if i have in the "checker" file 3 page i need to chek there is no more in the selected file. I tried with a array but is to much complicated like this thanks!!
XElement pageElement = metadataFile.Root.Element("Pages");
int cntPage = ((IEnumerable<XElement>)pageElement.Elements()).Count();
if (cntPage < 1 || cntPage > 3) errorDetails += "Number of Pages wrong!!";