From lmontmailler at edap-tms.com Tue Jan 7 07:42:37 2020 From: lmontmailler at edap-tms.com (Laurent MONTMAILLER) Date: Wed Jan 8 06:37:20 2020 Subject: [xsd-users] XSD codesynthesis code generator modification Message-ID: Hi, I'm using the XSD codesynthesis code generator : C++ / Tree for XML data binding. I would like to go further and modify the source code of the generator to customize its behavior and match my real needs. Could you please confirm to me that's possible to do it (customize the code) and give me a location (url) where to find and download this source code ? For information: I'm using Microsoft Visual Studio / Windows 10. Best regards, Laurent MONTMAILLER Ing?nieur R&D logiciel / R&D software engineer EDAP TMS 4 rue du Dauphin? - 69120 Vaulx-en-Velin, FRANCE Tel. +33 (0)4 72 15 31 50 - Fax +33(0)4 72 15 31 51 www.edap-tms.com [Facebook icon] [LinkedIn icon] [Twitter icon] [Twitter icon] [Logo] [Banner] From boris at codesynthesis.com Thu Jan 9 07:43:23 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jan 9 07:47:52 2020 Subject: [xsd-users] XSD codesynthesis code generator modification In-Reply-To: References: Message-ID: Laurent MONTMAILLER writes: > I'm using the XSD codesynthesis code generator : C++ / Tree for XML data > binding. I would like to go further and modify the source code of the > generator to customize its behavior and match my real needs. Could you > please confirm to me that's possible to do it (customize the code) [...] While you can certainly go this route, the C++/Tree mapping also provides the ability to customize the generated code without modifying the compiler. See this page for details: http://wiki.codesynthesis.com/Tree/Customization_guide > [...] and give me a location (url) where to find and download this source > code ? The source code is available from the project page: https://codesynthesis.com/projects/xsd/ There is also the Git repository: https://git.codesynthesis.com/cgit/xsd/ From lmontmailler at edap-tms.com Thu Jan 9 09:05:38 2020 From: lmontmailler at edap-tms.com (Laurent MONTMAILLER) Date: Thu Jan 9 10:10:49 2020 Subject: [xsd-users] XSD codesynthesis code generator modification In-Reply-To: References: Message-ID: Thanks Boris for your answer, I already studied those items (except Git repo), but did not find what I'm looking for... I would like for example override generated accessor methods (set/get) and add some features in the C++ generated classes : inheritance from an in-house class, additional includes, methods and so on... The goal is to modify the generator to make all that in an automatic way: at each code generation. I think I cannot do that the way it is explained in the customization guide... I'm also surprised not to find the generator C++ classes following the "source code" link (https://codesynthesis.com/projects/xsd/), but "only" header/templates files. For example, when I'm looking the string "Begin epilogue" that is written in the C++ generated classes, I find only "xsd.exe" but no C++ class(es) that I can modify, recompile an rebuild my customized xsd.exe. May be using the Git repo ? I hope you will understand me, ... Best regards, Laurent -----Message d'origine----- De : Boris Kolpackov Envoy? : jeudi 9 janvier 2020 13:43 ? : Laurent MONTMAILLER Cc : xsd-users@codesynthesis.com Objet : Re: [xsd-users] XSD codesynthesis code generator modification Laurent MONTMAILLER writes: > I'm using the XSD codesynthesis code generator : C++ / Tree for XML > data binding. I would like to go further and modify the source code of > the generator to customize its behavior and match my real needs. Could > you please confirm to me that's possible to do it (customize the code) > [...] While you can certainly go this route, the C++/Tree mapping also provides the ability to customize the generated code without modifying the compiler. See this page for details: http://wiki.codesynthesis.com/Tree/Customization_guide > [...] and give me a location (url) where to find and download this > source code ? The source code is available from the project page: https://codesynthesis.com/projects/xsd/ There is also the Git repository: https://git.codesynthesis.com/cgit/xsd/ www.edap-tms.com [Facebook icon] [LinkedIn icon] [Twitter icon] [Twitter icon] [Logo] [Banner] From boris at codesynthesis.com Fri Jan 10 08:32:11 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jan 10 08:36:42 2020 Subject: [xsd-users] XSD codesynthesis code generator modification In-Reply-To: References: Message-ID: Laurent MONTMAILLER writes: > I would like for example override generated accessor methods (set/get) > and add some features in the C++ generated classes : inheritance from > an in-house class, additional includes, methods and so on... The goal > is to modify the generator to make all that in an automatic way: at > each code generation. I think I cannot do that the way it is explained > in the customization guide... You can probably achieve most of this, though it will require some effort and for a large schema with many types, may be quite tedious. > I'm also surprised not to find the generator C++ classes following the > "source code" link (https://codesynthesis.com/projects/xsd/), but "only" > header/templates files. You need to download the source code archive, not the pre-build binary. Specifically, xsd-4.0.0+dep.tar.bz2 from: https://codesynthesis.com/download/xsd/4.0/ Then follow the instructions in: https://codesynthesis.com/projects/xsd/extras/build-windows.xhtml From lmontmailler at edap-tms.com Fri Jan 10 09:28:42 2020 From: lmontmailler at edap-tms.com (Laurent MONTMAILLER) Date: Fri Jan 10 09:37:50 2020 Subject: [xsd-users] XSD codesynthesis code generator modification In-Reply-To: References: Message-ID: Thank you very much Boris for your support. Best regards Laurent -----Message d'origine----- De : Boris Kolpackov Envoy? : vendredi 10 janvier 2020 14:32 ? : Laurent MONTMAILLER Cc : xsd-users@codesynthesis.com Objet : Re: [xsd-users] XSD codesynthesis code generator modification Laurent MONTMAILLER writes: > I would like for example override generated accessor methods (set/get) > and add some features in the C++ generated classes : inheritance from > an in-house class, additional includes, methods and so on... The goal > is to modify the generator to make all that in an automatic way: at > each code generation. I think I cannot do that the way it is explained > in the customization guide... You can probably achieve most of this, though it will require some effort and for a large schema with many types, may be quite tedious. > I'm also surprised not to find the generator C++ classes following the > "source code" link (https://codesynthesis.com/projects/xsd/), but "only" > header/templates files. You need to download the source code archive, not the pre-build binary. Specifically, xsd-4.0.0+dep.tar.bz2 from: https://codesynthesis.com/download/xsd/4.0/ Then follow the instructions in: https://codesynthesis.com/projects/xsd/extras/build-windows.xhtml www.edap-tms.com [Facebook icon] [LinkedIn icon] [Twitter icon] [Twitter icon] [Logo] [Banner] From killtech at gmx.net Mon Jan 27 14:52:02 2020 From: killtech at gmx.net (killtech@gmx.net) Date: Tue Jan 28 07:46:07 2020 Subject: [xsd-users] --ordered-type-xxx breaks serialization Message-ID: <04ae73f2-d58e-4572-1a56-45609710b516@gmx.de> Hi everybody, I'm using the XSD code generator for reading some complex XML files, "patch" some data, and store the XML file back. In order to check the input and the output file, I use the --ordered-type-all option so that I can use graphical diff tools like kdiff3. Up to now, I was just patching some attribute values or the content of pure text nodes. Everything has been working fine. Now, I have to extend some element lists (elements with minOccurs="0" maxOccurs="unbounded") and try to export the XML file again: my new item is NOT stored. I've tried various approaches, tried to create empty lists and fill them afterwords - neither worked. After two days of trail & error, I started with a new test program (from your Hello world example) and extended the schema one by one to fulfill my needs: Everything worked as expected =-O ... until I found out that the compilation of the test program doesn't use the "--ordered-type-all" option. If I add this option to the Makefile, the simple test program also fails to store extended lists. If you need some example code, feel free to contact me. Hk From boris at codesynthesis.com Tue Jan 28 07:48:19 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jan 28 07:53:47 2020 Subject: [xsd-users] --ordered-type-xxx breaks serialization In-Reply-To: <04ae73f2-d58e-4572-1a56-45609710b516@gmx.de> References: <04ae73f2-d58e-4572-1a56-45609710b516@gmx.de> Message-ID: killtech@gmx.net writes: > In order to check the input and the output file, I use the > --ordered-type-all option so that I can use graphical diff tools like > kdiff3. > > Up to now, I was just patching some attribute values or the content of > pure text nodes. Everything has been working fine. > > Now, I have to extend some element lists (elements with minOccurs="0" > maxOccurs="unbounded") and try to export the XML file again: my new item > is NOT stored. Have you updates the content_order sequence to correspond to the changes you've made? See "Element Order" for details: https://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.8.4 From killtech at gmx.de Tue Jan 28 13:49:27 2020 From: killtech at gmx.de (=?UTF-8?Q?Heiko_Br=c3=bcmmer?=) Date: Wed Jan 29 05:00:49 2020 Subject: [xsd-users] --ordered-type-xxx breaks serialization In-Reply-To: References: <04ae73f2-d58e-4572-1a56-45609710b516@gmx.de> Message-ID: Hi Boris, thanks for that tip - I really missed that chapter. Adding content_order to the specific collection solved my problem of missing elements. After some more investigation, I found out that keeping content order of the first level elements is sufficient, so I use --ordered-type now and don't have to care of the content_order of the deeper levels where I add some items... Hk Am 28.01.20 um 13:48 schrieb Boris Kolpackov: > killtech@gmx.net writes: > >> In order to check the input and the output file, I use the >> --ordered-type-all option so that I can use graphical diff tools like >> kdiff3. >> >> Up to now, I was just patching some attribute values or the content of >> pure text nodes. Everything has been working fine. >> >> Now, I have to extend some element lists (elements with minOccurs="0" >> maxOccurs="unbounded") and try to export the XML file again: my new item >> is NOT stored. > Have you updates the content_order sequence to correspond to the changes > you've made? See "Element Order" for details: > > https://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.8.4