[xsde-users] Supporting multiple versions of a schema that are not completely backward compatible

Rangarajan, Ravi_Sowmian raviraja at qti.qualcomm.com
Wed Jul 8 02:32:52 EDT 2015


Hi Boris,

I have to support both the old (version 1) schema as well as newer (version 3) schema and I believe newer schema will be forward compatible, but not completely backward compatible. Based on a run-time flag, I need to construct xml file based on old schema or the new schema - so, the decision has to be at run-time, not compile time via #ifdef.



Ver1 schema includes ScheduleDescription.xsd and schema_version.xsd (contents of schema_version.xsd are pretty much common for both versions), while Ver3 schema includes Schedule_Rel_9.xsd, Schedule-Rel-11-schema-snippet.xsd, Schedule-Release-12-schema-snipper.xsd and schema_version.xsd files.



Basically, name space (xml_schema), most of the class names & APIs are same in generated cpp code, which results in a bunch of multiple definition errors during linking that happens while generating application binary (first definition in ScheduleDescription.o and redefinition in Schedule_Rel_9.o).



- Is it possible to change name space for say the newer schema so both can co-exist and application code can call respective schema's APIs a run time? If yes, how can I achieve that?



- If changing namespace for the newer schema is not possible, then other approach might be to use newer schema alone and whenever an XM file needs to be constructed per old schema, one may have to remove/reset/set few fields to mock old schema, but am not quite sure how to go about those steps needed for the same. Any tips on how to use single schema and mock support for both versions of the schemas?



Greatly appreciate your help regarding this.

Thanks

Ravi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Schedule_Rel_9.xsd
Type: text/xml
Size: 4504 bytes
Desc: Schedule_Rel_9.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20150708/a0d4aa94/Schedule_Rel_9-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schema_version.xsd
Type: text/xml
Size: 377 bytes
Desc: schema_version.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20150708/a0d4aa94/schema_version-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Schedule-Rel-12-schema-snippet.xsd
Type: text/xml
Size: 898 bytes
Desc: Schedule-Rel-12-schema-snippet.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20150708/a0d4aa94/Schedule-Rel-12-schema-snippet-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Schedule-Rel-11-schema-snippet.xsd
Type: text/xml
Size: 782 bytes
Desc: Schedule-Rel-11-schema-snippet.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20150708/a0d4aa94/Schedule-Rel-11-schema-snippet-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScheduleDescription.xsd
Type: text/xml
Size: 3527 bytes
Desc: ScheduleDescription.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20150708/a0d4aa94/ScheduleDescription-0001.bin


More information about the xsde-users mailing list