views:

22

answers:

1

I have an .xsd file stored as a resource in my vb.net project. I need to create an instance of the XmlSchema class using this resource. Any examples of creating an XmlSchema I can locate do one of the following: Create the xmlschema by adding elements and attributes manually like this example. Create the xmlschema using an XmlTextReader which requires a path to a physical file like this example.

Neither of these examples apply to my situation. I need to create an XmlSchema using either the .xsd stored as a resource or similarly the string that is easily extracted from the resource file.

Any assistance is appreciated.

A: 

After more digging I ended up with the following solution:

Dim xReader As New XmlTextReader(New StringReader(My.Resources.fd.ToString()))
Dim xmlSchema As New XmlSchema()
xmlSchema.Read(xReader, AddressOf ValidationCallback)
CletusLoomis