> I use C# to validate an XML document. It issues error messages and I do not
> understand why.
> I import it in the C# solution and I create from the XML Menu the Schema:
>
[quoted text clipped - 6 lines]
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> attributeFormDefault="qualified" elementFormDefault="qualified">
Where does you C# application load that schema?
> XmlTextReader r = new XmlTextReader(@"C:\Applications\C
> Sharp\My_Tests\CS_XML_XSD_Schema\books.xml");
[quoted text clipped - 6 lines]
>
> new ValidationEventHandler(MyValidationEventHandler);
You need something like
v.Schemas.Add("http://tempuri.org/books.xsd", "books.xsd");
where of course the second argument might need some file path besides
that file name, depending on where your schema is stored.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Doru Roman - 30 Mar 2006 17:51 GMT
Thanks a lot, that did the job.
I got the example from a site, it seems that not always they are reliable.
>> I use C# to validate an XML document. It issues error messages and I do
>> not understand why.
[quoted text clipped - 27 lines]
> where of course the second argument might need some file path besides that
> file name, depending on where your schema is stored.