[XML] Including other schema files - validating
We've recently added a new capability to our system to read XML files which have been translated from standard EDI documents. The EDI vendor we are working with gave use the XML Schema Documents (xsd) that they use for validating the transformation. To keep the files small and manageable, the schema was broken up based on the transaction type, with one parent XSD to tie them all together (insert LOTR reference here... I'll wait.....)
Ok, so in that parent document, there's this line:
Code:
<xs:include schemaLocation="TransType1.xsd" />
I know that I can take an XML Dom Document object, load the XML file into it, then load a second XML Dom Document object with the schema file and use it to validate the XML document... What I want to know though..... will it be able to load the second schema to parse and validate the items that are defined in the TransType1.xsd schema? Or does it need to be loaded on it's own, and how can I combine the parent schema and the child schema together to validate the file?
Currently we're using VB6, with plans to go to .NET (some day), so solutions in either will be fine.
The wya the system is now, we're loading the XML document in to a Dom Object, parsing out the nodes we want, inserting them into the database, THEN validating the data we jsut imported..... Which is OK, for this client at this particular part of the country.... but should another client buy this option that is in a DIFFERENT part of the country..... things are going to hit the fan.
So, I'm looking for the better mouse trap to use until we get the chance to upgrade it and move it to .NET..... not holding my breath for that tho....
-tg