Validating xmlreader

I can always go back to the old validation method, but those warnings scare me. settings.schemas.compile() was added, and the insignificant reorganization of the "using(xmlreader reader..

I've been trying to work out how to validate XML against XSD in PHP but failed to do so due to lack of examples. I've came up with example below but it doesn't work properly.

@Dave Random The DOM is powerful, but that power comes with a cost. XMLReader enables you to read a document much more efficiently, plus you can load single nodes into the dom when you need to.

All nodes returned from the given Xml Reader are also returned from this validating reader, so there is no information loss in the process.Linq To xml Validate Using XSD (LINQ to XML):, This article explains all possible ways to validate xml, using C#: IMO best option is to use XSD.Best regards Cathy MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue.The Add method receives as arguments a namespace URI that identifies the schema ( and the name and location of the schema file (in the current directory).Create and set the properties of an Xml Reader Settings object.I think my problem is setting up the readers and the input streams. Source Uri = xsd_file; Xml Schema Set ss = new Xml Schema Set(); ss. Source Uri = xsd_file; Xml Schema Set ss = new Xml Schema Set(); ss.


Leave a Reply