"simon ames" <am***************@hotmail.com> wrote in message news:#F*************@TK2MSFTNGP12.phx.gbl...
I'm creating the XML on the fly in an ASP.NET page and need to validate it
aginst the schema to ensure its well formed.
Simon,
It's not necessary to validate an XML document against a schema
to ensure it is well formed.
Well-formedness checking is a fundamental XML requirement.
Testing the schema validity of some XML makes a much stronger
statement about a document (and entails paying a greater price
in performance).
Just load the XML into an XmlDocument. The Load( ) method
throws an XmlException when the XML is not well formed.
Validate against a schema when you want to ensure that an XML
document is schema-valid, and/or you require the Post Schema
Validation Infoset (PSVI). The class to use for this purpose is an
XmlValidatingReader, which you can wrap around an XmlText-
Reader (which you can wrap around a number of sources: reader,
stream, URL).
Derek Harmon