I have the following XML file like this:
<?xml version="1.0" encoding="utf-8"?>
<Config version="Vs1.00.00"><!-- xmlns="urn:xmldata-schema">-->
<<SystemSettings>
<Workstation></Workstation>
<Company></Company>
<InstallationDate></InstallationDate>
<SupportContactLine1></SupportContactLine1>
<SupportContactLine2></SupportContactLine2>
<SupportContactLine3></SupportContactLine3>
<UserFile></UserFile>
</SystemSettings>
<Settings>
<StartUpWorkspace></StartUpWorkspace>
<StartLanguage></StartLanguage>
<ExportPath></ExportPath>
<ImportPath></ImportPath>
<BackUpRestorePath></BackUpRestorePath>
<AdjHistoryPath></AdjHistoryPath>
<TestHistoryPath></TestHistoryPath>
<LogFilePath></LogFilePath>
</Settings>
<DefaultSettings>
<DefaultSupportLine1></DefaultSupportLine1>
<DefaultSupportLine2></DefaultSupportLine2>
<DefaultSupportLine3></DefaultSupportLine3>
<DefaultUserFile></DefaultUserFile>
<DefaultStartUpWorkspace></DefaultStartUpWorkspace>
<DefaultStartLanguage></DefaultStartLanguage>
<DefaultWorkspacePath></DefaultWorkspacePath>
<DefaultExportPath></DefaultExportPath>
<DefaultImportPath></DefaultImportPath>
<DefaultBackUpRestorePath></DefaultBackUpRestorePath>
<DefaultAdjHistoryPath></DefaultAdjHistoryPath>
<DefaultTestHistoryPath></DefaultTestHistoryPath>
<DefaultLogFilePath></DefaultLogFilePath>
<DefaultMasterPassword crypt="No"></DefaultMasterPassword>
<DefaultLogger></DefaultLogger>
</DefaultSettings>
</Config>
I need to validate another XML file. Is there a way I can check another XML file if it has the same structure as my file here?
You need an XSD file to check whether an xml is proper. If you do not have the xsd file, some tools may create xsd from xml, but you may need to modify created xsd.
This answer describes how to validate an xml file in c# against an XSD file.