Subject: SAX Validation against multiple XSDs in MSXML
Posted By: Satnam Post Date: 8/29/2006 4:11:15 AM


I'm using MSXML 6.0 for SAX parsing in a C++ application.

How do I validate my XML against an XSD which is in-memory (not a physical file), and which in turn references 3 other XSDs through the <xsd:include schemaLocation="abc.xsd"/> construct?
All the four XSDs are housed inside a DLL and have to be used without converting them to actual files.

Currently, I am following the steps below to accomplish the desired validation:

1. Writing the contents of the primary xsd to a IStream
2. Attaching this IStream to a IXMLDOMDocument, and then
3. Parse this xsd to retreive the name of the other three xsds it internally reference
4. Extract the bodies of each of these xsds and insert them one-by-one just after the header of the main xsd.
5. The new (& large) programmatically created xsd is then added to the IXMLDOMSchemaCollection2.

This is resulting in a huge performance-hit, and the performance benefits for which I am shifting  from xerces to MSXML remains unjustified.
Request you to please suggest a better method of performing validation in this scenario.

Regards,
Satnam

Go to topic 48990

Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182