I'm having problems with some XML schema validation. The problem occurs when I perform and add to a schema collection:
IXMLDOMSchemaCollection2 *pIXMLDOMSchemaCollection=NULL;
HRESULT hr = CoCreateInstance( CLSID_XMLSchemaCache40, NULL, CLSCTX_SERVER, IID_IXMLDOMSchemaCollection,
(LPVOID*)( &pIXMLDOMSchemaCollection) );
SUCCEEDED(hr) ? 0 : throw hr;
hr = pIXMLDOMSchemaCollection->add( _bstr_t( _T(""
),
_variant_t("Schema.xsd"
);
//...
Now this add works fine as long as the Schema is balled up in one nice little file. Unfortunately, the powers that be have decided to split this up into 3 files. Let's say Schema.xsd includes Schema2.xsd includes Schema3.xsd:
Schema.xsd:
<xs:schema xmlns:xs="xs:noNamespaceSchemaLocation="" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="Schema2.xsd"/>
Similar for Schema2.xsd...I know the "include schemaLocation" is used by xmlSpy, which is the tool the files I'm working with were created.
Does anyone know a way that validation against schema can be accomplished if the schema is split into more than one file?
Any comments and suggestions are greatly appreciated.
Thanks,
Kenneth Woodruff
IXMLDOMSchemaCollection2 *pIXMLDOMSchemaCollection=NULL;
HRESULT hr = CoCreateInstance( CLSID_XMLSchemaCache40, NULL, CLSCTX_SERVER, IID_IXMLDOMSchemaCollection,
(LPVOID*)( &pIXMLDOMSchemaCollection) );
SUCCEEDED(hr) ? 0 : throw hr;
hr = pIXMLDOMSchemaCollection->add( _bstr_t( _T(""
_variant_t("Schema.xsd"
//...
Now this add works fine as long as the Schema is balled up in one nice little file. Unfortunately, the powers that be have decided to split this up into 3 files. Let's say Schema.xsd includes Schema2.xsd includes Schema3.xsd:
Schema.xsd:
<xs:schema xmlns:xs="xs:noNamespaceSchemaLocation="" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="Schema2.xsd"/>
Similar for Schema2.xsd...I know the "include schemaLocation" is used by xmlSpy, which is the tool the files I'm working with were created.
Does anyone know a way that validation against schema can be accomplished if the schema is split into more than one file?
Any comments and suggestions are greatly appreciated.
Thanks,
Kenneth Woodruff