xsd - How to validate an XML file with a schema in memory with .NET? -
Rather than using a physical file, using XSD loaded from embedded application resources over runtime It is possible
You XmlSchemaCollection.Add (string, XmlReader)
:
string file = "assembly.Namespace.FileName.ext"; XmlSchemaCollectionxsc = New XmlSchemaCollection (); Xsc.Add (empty, new XmlTextReader (this.GetType (). Assembly.GetManifestResourceStream (file)));
Comments
Post a Comment