I first posted my question here but now I'm thinking it's more of a .NET thing, not really sure. Apologies for a cross-post.

I'm letting the user upload an xml file, which will then be processed. That works fine, but now I want to validate.

Here's the start of an xml file:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<SleuthNameInfo
xmlns="http://sleuthsoftware.com/MasterNameLookup"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:SchemaLocation = "http://sleuthsoftware.com/MasterNameLookup SleuthNameInfo.xsd"
xsi:noNamespaceSchemaLocation="SleuthNameInfo.xsd"
ORI="NM1234567">
I place the uploaded file into a "uploaded-data" folder directly underneath the root. I put some code in to enable a validating reader:
Code:
Response.Write("Processing file...<br>");
XmlTextReader textReader = new XmlTextReader(Session["FileName"].ToString());
textReader.WhitespaceHandling = WhitespaceHandling.None;
XmlValidatingReader reader = new XmlValidatingReader(textReader);
reader.ValidationType = ValidationType.Schema;
reader.ValidationEventHandler += new System.Xml.Schema.ValidationEventHandler(reader_ValidationEventHandler);
but on the first reader.Read(), I get this error message:
Cannot load schema for the namespace '' - Could not find file "C:\Inetpub\wwwroot\MasterNameLookup\uploaded-data\SleuthNameInfo.xsd".. An error occurred at file:///C:/Inetpub/wwwroot/MasterNameLookup/uploaded-data/Nm1234567-20041214054209.xml, (2, 2).
So then I put a copy of my .xsd in the "uploaded-data" folder, and now I get this:
The attribute targetNamespace does not match the designated namespace URI. An error occurred at file:///C:/Inetpub/wwwroot/MasterNameLookup/uploaded-data/SleuthNameInfo.xsd, (3, 2).
Apparently now the validating reader found the schema, but it doesn't like it. Can anyone help me out?

Thanks,
Mike