Here is what I've tried (doesn't work):
//get the xsd stream from the assembly, where it is an embedded
resource
Assembly assembly = Assembly.GetExecutingAssembly();
System.IO.Stream = assembly.GetManifestResourceStream("MyNamespace.MyXsd.xsd");
//create a reader to read the schema, set the XmlResolver property
XmlValidatingReader schemaReader = new XmlValidatingReader(xsdStream,
XmlNodeType.Document, null);
//my custom resolver
XmlResolver resolver = new XmlEmbeddedResourceResolver();
schemaReader.XmlResolver = resolver;
//create the reader for the xml document
XmlValidatingReader reader = new XmlValidatingReader(xmlDoc,
XmlNodeType.Document, null);
reader.XmlResolver = resolver;
reader.ValidationType = ValidationType.Schema;
//here is where it all blows up because it can't resolve the
references to the
//included schemas. It doesn't even try to use my resolver (I set
breakpoints)
reader.Schemas.Add(null, schemaReader);
Please help!
--
This post is provided "AS IS" with no warranties, and confers no rights.
"Maggie" <mag...@obscure.org> wrote in message
news:446c4a2d.03030...@posting.google.com...