Validate XML - Unable to add Schema to Schema Collection
I have some xml validation code that validates xml against an external schema. Problem is that it doesn't entirely work for some of the complex OTA (www.opentravel.org) xsd that I am trying to validate against. These schemas have multiple included schemas and refernces to other schemas and attribute groups.
When I try to add one of these schemas to my schemacollection it errors out because it is unable to find some of the types defined in the included schemas. It seems to do fine going down one level to a referenced schema, but once that schema references another schema that is when I get errors.
The schema I am specifically trying to validate against is OTA_TravelItineraryRS.xsd, I am using the supplied sample xml file, but when I validate it throws up an error in one of the included schemas about "Type 'Money' is not declared or not a simple type. An error occurred at file:///C:/Delete/OTA_CommonTypes.xsd, (85, 4). " I have tried other OTA schemas and sample files and get very similar errors.
All of the schemas are locally in the same directory. To get to this error essentially the OTA_TravelItineraryRS.xsd includes other schemas one of which is OTA_CommonTypes.xsd. The money type that the error is talking about is found in OTA_SimpleTypes.xsd which is referenced by OTA_CommonTypes.xsd (technically 2 files deep).
Everything pans out and the code seems to be smart enough to drill down to CommonTypes schema to get info for the TravelItinerary, but once there it needs to drill down to SimpleTypes and for some reason its not doing it. Any ideas?
If you need more info let me know. I have attached the entire OTA 2004B schema that includes all the xsd and sample xml files if you want to try it out for yourself.
Last edited by coenen; Dec 28th, 2004 at 03:47 PM.