John H wrote:
How can i just use the XmlDocument object to validate an xml instanace
against a schema referenced inside the xml instance?
The Load method seems to not validate it against the schema.
There is an overload for the Load method that takes an XmlReader:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlDocumentClassLoadTopic4.asp>
There you can pass in an XmlValidatingReader set up properly which
performs the validation.
With .NET 2.0 there is also a new method called Validate
<http://msdn2.microsoft.com/en-us/library/ms162370(en-US,VS.80).aspx>
which allows you to validate the document after it has been loaded and
manipulated.
See also
<http://66.129.71.130/QuickStartv20/howto/doc/Xml/ValidationReadingXML.aspx>
<http://66.129.71.130/QuickStartv20/howto/doc/Xml/XmlDocumentValidation.aspx>
for .NET 2.0 specific changes respectively solutions.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/