Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: validating XML with XmlValidatingReader against schema that use xs:include

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 4/3/2005 2:29:00 PM

davidmcb@p... wrote:


> 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);

Try explicitly setting a resolver e.g
   xsd.XmlResolver = new XmlUrlResolver();
see also the documentation
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlValidatingReaderClassXmlResolverTopic.asp>


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent