I'm doing xml validation from an xsd file like this:
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("urn:bookstore-schema", @"D:\Arquivo\VoltVarPlanning.xsd");
Validate("D:/Arquivo/Exemplo_Saida.xml", schemaSet);
But I do not want to get my VoltVarPlanning.xsd file from outside my application, as I'm doing:
schemaSet.Add("urn:bookstore-schema", @"D:\Arquivo\VoltVarPlanning.xsd");
So I put the .xsd into the same path as the service that does this validation. But I can not get the VoltVarPlanning.xsd in the path, it's error, because it can not find the file.
I did it that way, but it does not work:
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("urn:bookstore-schema", @"\VoltVarPlanning.xsd");
Validate("D:/Arquivo/Exemplo_Saida.xml", schemaSet);
How do I get xsd, and is it already within my Solution?