On this project, it's a (light) requirement that we use the specification schemas unchanged. So, I pass in a custom resolver that will find the correct schema given the URI (the value in the schema Location attribute) and return it, in this example, as a stream.
Here we just grab the relative filename from out of the file:/// URI that we're passed into Get Entity each time a schema Location needs to be resolved. I wrap the whole thing in a factory method and cache the compiled Xml Schema Collection so we don't load and compile this more than once. I've seen folks build Assembly schemas like assembly:/// and embed stuff in the schemas, but eh, who has the time.
" _ & "&ent;" Private Sub Form1_Load(By Val sender As System.
Load Dim reader As Xml Text Reader = New Xml Text Reader(New String Reader(target)) While reader.
The reader does not add anything to the Xml Schema Collection.