Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Schema Validation

Status
Not open for further replies.

spUnk

Programmer
Jul 2, 2003
1
US
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=&quot;xs:noNamespaceSchemaLocation=&quot;&quot; elementFormDefault=&quot;qualified&quot; attributeFormDefault=&quot;unqualified&quot;>
<xs:include schemaLocation=&quot;Schema2.xsd&quot;/>

Similar for Schema2.xsd...I know the &quot;include schemaLocation&quot; 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top