![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: validating XML with XmlValidatingReader against schema that use xs:include validating XML with XmlValidatingReader against schema that use xs:includeTo: NULL Date: 4/2/2005 9:43:00 AM Hello,
I have a working validating parser, written with C#, that uses the
XmlValidatingReader class. My schema library contains a set of nearly
identical schema, except for a few types. The obvious thing to do is
to break out the common types into a single schema, then 'include'
(xs:include) that schema in the other schemas.
The problem is that when I try to do that, the validator is no longer
able to find the type definitions contained in the included schema,
even though the schema are all in the same directory. Another point is
that I want to avoid hardcoding the schema or passing the schema as an
argument to the validator. I just want to pass in the XML document
filename, then use the references to the schema found in the XML
document itself.
My code is pretty standard:
XmlTextReader xml = new XmlTextReader(filename);
XmlValidatingReader xsd = new XmlValidatingReader(xml);
xsd.ValidationEventHandler += new
ValidationEventHandler(MyValidationEventHandler);
while (xsd.Read()) {}
etc.
Any help is appreciated.
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
