[xsde-users] RE: Supporting multiple versions of schemas that are not completely backward compatible

Sowmian rsowmian at hotmail.com
Wed Jul 8 18:45:31 EDT 2015


Hi Boris,My follow-up email from work bounced back, so am sending the same from my personal email address. Could you pls. clarify the details I am not quite sure about? Thanks.
Hi Boris,

Sorry, if you received multiple copies of my original
request for multiple schemas with same namespace. I will read through the
evolution examples. But I am quite clear on how to use --namespace-map compiler
flag.

 

1. How exactly should I use --namespace-map in our
makefile such that namespace for old schema is scheduleDescriotion_v1 and
namespace for newer schema is scheduleDescriptionv3 ?

 

2. If we add a flag in our makefile, it'd be common for
all files compiled under that directory, right? Did you mean I move newer
schema to a different dir and have a different makefile for it?

 

Thanks again for your help.

Ravi 

 

-----Original Message-----

From: Boris Kolpackov [mailto:boris at codesynthesis.com] 

Sent: Wednesday, July 08, 2015 9:14 AM

To: Rangarajan, Ravi_Sowmian

Cc: xsde-users at codesynthesis.com

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

 

Hi Ravi,

 

Rangarajan, Ravi_Sowmian <raviraja at qti.qualcomm.com>
writes:

 

> - 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?

 

Yes, use the --namespace-map (or --namespace-regex)
option.

 

 

> - 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?

 

XSD/e includes support for schema evolution. I am not sure
how applicable it will be to your case, but it may be worth familiarizing
yourself with it; see the examples in the 'evolution' directory.

 

BorisFrom: rsowmian at hotmail.com
To: xsde-users at codesynthesis.com
Subject: Supporting multiple versions of schemas that are not completely backward compatible
Date: Tue, 7 Jul 2015 23:41:30 -0700




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 		 	   		   		 	   		  


More information about the xsde-users mailing list