From raviraja at qti.qualcomm.com Wed Jul 8 02:15:46 2015 From: raviraja at qti.qualcomm.com (Rangarajan, Ravi_Sowmian) Date: Wed Jul 8 02:15:54 2015 Subject: [xsde-users] Supporting multiple versions of schemas with mostly common class/API names Message-ID: Hi Boris, I have to support both the old (ver 1) schema as well as newer (ver 3) schema and I believe newer schema will be forward compatible, but not backward compatible. Based on a config 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 which 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) and many class names are same in generated cpp code, which results in multiple definition error 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/ba3dc280/Schedule_Rel_9.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/ba3dc280/Schedule-Rel-11-schema-snippet.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/ba3dc280/Schedule-Rel-12-schema-snippet.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/ba3dc280/schema_version.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/ba3dc280/ScheduleDescription.bin From raviraja at qti.qualcomm.com Wed Jul 8 02:32:52 2015 From: raviraja at qti.qualcomm.com (Rangarajan, Ravi_Sowmian) Date: Wed Jul 8 02:36:03 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible Message-ID: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> 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 From boris at codesynthesis.com Wed Jul 8 12:14:16 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 8 12:14:25 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible In-Reply-To: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> References: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> Message-ID: Hi Ravi, Rangarajan, Ravi_Sowmian 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. Boris From raviraja at qti.qualcomm.com Wed Jul 8 18:30:31 2015 From: raviraja at qti.qualcomm.com (Rangarajan, Ravi_Sowmian) Date: Wed Jul 8 18:30:39 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible In-Reply-To: References: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> Message-ID: 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@codesynthesis.com] Sent: Wednesday, July 08, 2015 9:14 AM To: Rangarajan, Ravi_Sowmian Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible Hi Ravi, Rangarajan, Ravi_Sowmian 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. Boris From rsowmian at hotmail.com Wed Jul 8 18:45:31 2015 From: rsowmian at hotmail.com (Sowmian) Date: Thu Jul 9 10:56:35 2015 Subject: [xsde-users] RE: Supporting multiple versions of schemas that are not completely backward compatible In-Reply-To: References: Message-ID: 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@codesynthesis.com] Sent: Wednesday, July 08, 2015 9:14 AM To: Rangarajan, Ravi_Sowmian Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible Hi Ravi, Rangarajan, Ravi_Sowmian 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@hotmail.com To: xsde-users@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 From boris at codesynthesis.com Thu Jul 9 10:59:21 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 9 10:59:29 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible In-Reply-To: References: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> Message-ID: Hi Ravi, Rangarajan, Ravi_Sowmian writes: > 1. How exactly should I use --namespace-map in our makefile [...] That you would have to figure out yourself. I cannot be writing makefiles for you. Normally you would have two invocations of XSD/e with two different --namespace-map values for the two schemas. Boris From raviraja at qti.qualcomm.com Fri Jul 10 02:33:35 2015 From: raviraja at qti.qualcomm.com (Rangarajan, Ravi_Sowmian) Date: Fri Jul 10 02:33:55 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible In-Reply-To: References: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> Message-ID: <7c9aff50bd7c45ceb98e4c84e673c543@NASANEXM01E.na.qualcomm.com> Hi Boris, I was just asking for an example for argument that needed to be passed on to namespace-map switch. I was able to figure out exact string that needs to be given and tried placing two schemas in different directories (different makefiles) and now am able to generate different namespaces for both. I don't see the evolution directory you mentioned for examples under our code synthesis installation dir. Are these examples on any website or is there any other way I can take a look at these examples for evolution? Thank you Ravi -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Thursday, July 09, 2015 7:59 AM To: Rangarajan, Ravi_Sowmian Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible Hi Ravi, Rangarajan, Ravi_Sowmian writes: > 1. How exactly should I use --namespace-map in our makefile [...] That you would have to figure out yourself. I cannot be writing makefiles for you. Normally you would have two invocations of XSD/e with two different --namespace-map values for the two schemas. Boris From boris at codesynthesis.com Fri Jul 10 10:33:15 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 10 10:33:21 2015 Subject: [xsde-users] Supporting multiple versions of a schema that are not completely backward compatible In-Reply-To: <7c9aff50bd7c45ceb98e4c84e673c543@NASANEXM01E.na.qualcomm.com> References: <0b00efbe4b3d4dc297d58bd442b65509@NASANEXM01E.na.qualcomm.com> <7c9aff50bd7c45ceb98e4c84e673c543@NASANEXM01E.na.qualcomm.com> Message-ID: Hi Ravi, Rangarajan, Ravi_Sowmian writes: > I don't see the evolution directory you mentioned for examples > under our code synthesis installation dir. They are part of the standard XSD/e distribution that you can download from our website, in the examples/cxx/hybrid/evolution/ sub-directory: http://codesynthesis.com/products/xsde/download.xhtml Boris From raviraja at qti.qualcomm.com Fri Jul 17 02:35:14 2015 From: raviraja at qti.qualcomm.com (Rangarajan, Ravi_Sowmian) Date: Fri Jul 17 02:35:23 2015 Subject: [xsde-users] Q: Two delimiters with same name in a complex type Message-ID: <1ecef6f329544a538e6d84bc95e5c441@NASANEXM01E.na.qualcomm.com> Hi Boris, Complex type below, reoccurrenceStartStopType, has to sv::delimiter in it. Use cases I am interested in are Q1. After index, which is unsigned int type, we want to pack a delimiter, then I want to skip r11:receptionFiltering and r12:FDTInstanceURI fields and then pack r12:reoccurenceAndMonitoring type and another delimiter right after that. For e.g. 2001-12-17T09:00:47Z 2001-12-17T09:30:47Z 0 0 PT5M 0 Q2. When reoccurenceAndMonitoring is not packed, then I would like to pack two delimiters back to back after index. For e.g., 2001-12-17T09:00:47Z 2001-12-17T09:30:47Z 1 0 0 Auto generated code is such that it just packs as many delimiters as specified back to back - On the other hand, I am unable insert second delimiter of the same type & same name after packing ReoccurenceAndMonitoring field into sessionSchedule. Example 2 above can easily be achieved with current TBS implementation, whereas, example 1 is what I am asking this question for. Any tricks on how to facilitate independently packing two deliimiters under ReoccurenceStartStopType, especially when ReoccurenceAndMonitoring needs to be packed? Thanks in advance Ravi ### snippet from reference schema From boris at codesynthesis.com Tue Jul 21 12:31:47 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 21 12:31:50 2015 Subject: [xsde-users] Q: Two delimiters with same name in a complex type In-Reply-To: <1ecef6f329544a538e6d84bc95e5c441@NASANEXM01E.na.qualcomm.com> References: <1ecef6f329544a538e6d84bc95e5c441@NASANEXM01E.na.qualcomm.com> Message-ID: Hi Ravi, You are increasingly asking question that are very specific to your domain/application. You cannot expect me to spend hours trying to understand what's going on. In the future, if you have the "how do I do X" kind of question, you will need to state X in terms of simple, minimal example, not application domain "dumps". Rangarajan, Ravi_Sowmian writes: > Auto generated code is such that it just packs as many delimiters > as specified back to back - [...] I think the more correct way to state it would be that the schema specifies such an arrangement (and the generated code simply implements it; C++/Hybrid preserves precise schema element order). So what you are basically asking is: "my schema says the XML should look like this but I want it to look like that". The perfectly valid answer to this would be "you can't". With XSD/e, you can, with some effort. See type/parser/serializer customization for details. Boris