Obviously, not a good idea if you are reading gobs and gobs of XML. Lastly, don't forget to "manually" check your XML's default namespace is correctly referring to one of your validation schemas, because if its not your validating reader won't load the correct schema from your schema set and therefore won't give you any errors.Xml Validating Reader implements the Xml Reader class and provides support for data validation. Schemas property to have the reader validate using schema files cached in an Xml Schema Collection. Validation Type property specifies what type of validation the reader should perform. To read XML data from an Xml Node, use Xml Node Reader.Any properties set on the given Xml Text Reader also applies to this validating reader.I'm trying to write something in Java that receives an XML string and validates it against an XSD schema, and does automatic error handling for some simple common errors, and outputs a fixed XML string.
SAX1: Underlying API to parse an XML document, used directly when no URI is available. If you do not need data validation, the ability to resolve general entities, or support for default attributes, use Xml Text Reader.Write-only Sets the Xml Resolver used for resolving external DTD and schema location references. You need to do something like the following in order to create a validating reader now: All the interesting configuration for the validation now hangs off the Xml Reader Settings. By the way, don't forget that Xml Reader supports line and column information via the IXml Line Info interface.One thing that I tend to do with validating readers is to process the XML in two phases, like some compilers.