From debian at jff-webhosting.net Fri Sep 2 07:13:07 2016 From: debian at jff-webhosting.net (=?ISO-8859-1?Q?J=F6rg_Frings-F=FCrst?=) Date: Fri Sep 2 07:13:16 2016 Subject: [xsd-users] xsd Message-ID: <1472814787.8773.12.camel@jff-webhosting.net> Hello, I'm refreshing the package at Debian.? Can I get a list with important commits to include as patches? Many thanks! CU J?rg -- New: GPG Fingerprint: 63E0 075F C8D4 3ABB 35AB??30EE 09F8 9F3C 8CA1 D25D GPG key (long) : 09F89F3C8CA1D25D GPG Key????????: 8CA1D25D CAcert Key S/N : 0E:D4:56 Old pgp Key: BE581B6E (revoked since 2014-12-31). J?rg Frings-F?rst D-54470 Lieser Threema: SYR8SJXB IRC: j_f-f@freenode.net ?????j_f-f@oftc.net My wish list:? ?- Please send me a picture from the nature at your home. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160902/dc9f5fd4/attachment.pgp From boris at codesynthesis.com Mon Sep 5 12:11:44 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Sep 5 12:11:50 2016 Subject: [xsd-users] xsd In-Reply-To: <1472814787.8773.12.camel@jff-webhosting.net> References: <1472814787.8773.12.camel@jff-webhosting.net> Message-ID: Hi J?rg, J?rg Frings-F?rst writes: > Can I get a list with important commits to include as patches? You can take a look at the log here (from top until the 4.0.0 label; there aren't that many entries): http://scm.codesynthesis.com/?p=xsd/xsd.git;a=shortlog I think any thing that has "fix" in it is good to apply. Boris From damon.southworth at uk.bosch.com Tue Sep 6 08:17:14 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Tue Sep 6 08:17:26 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type Message-ID: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> Hello, I have a schema that uses an ordered type (sequence of choice elements) and have been successfully utilising the compiler feature that was introduced in version 4.0.0. to allow the ordering information to be maintained. I recently added the capability to stream the object model using a binary format with the -generate-insertion and -generate-extraction options. However I soon noticed that when the object model was serialised in this manner the receptor lost the ordered type information. A quick look around the generated code showed that the vector containing the ordering information Is not populated for the istream derived input serialisation: The XML parsing code contains a push into the content order vector that is missing from the binary serialisation input parsing code: // stepByName // . . . this->stepByName_.push_back (::std::move (r)); this->content_order_.push_back ( content_order_type (stepByName_id, this->stepByName_.size () - 1)); continue; Whereas the binary istream serialisation code only contains... ::std::size_t n; ::xsd::cxx::tree::istream_common::as_size< ::std::size_t > as (n); s >> as; if (n > 0) { stepByName_sequence& c (this->stepByName_); . . . c.push_back (::std::move (r)); } Manually editing the generated code allowed the binary serialisation to work correctly. So, I think the main question is what is my best way forward to fix this issue with the compiler as we always build from source and the schemas are part of the build pipeline? Or, maybe it is a known bug for which there is already a fix? Regards, Damon Southworth From boris at codesynthesis.com Thu Sep 8 12:18:49 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Sep 8 12:19:02 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> Message-ID: Hi Damon, Southworth Damon (AA-AS/EOS32) writes: > Manually editing the generated code allowed the binary serialisation to > work correctly. This is actually a lot trickier than that. To preserve element order in binary extraction you first need to insert them in the correct order (or save the ordering information in some other way). I've started working on this and it got pretty hairy very quickly. I will need to think some more on it in the next couple of days. Boris From damon.southworth at uk.bosch.com Thu Sep 8 12:53:53 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Thu Sep 8 12:54:07 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> Message-ID: Hi Boris, Thanks for the extra information, I think the example "ordered type" that I serialised was just too simple so I just got away with it. I admit that I have not run all our unit tests on the code using the binary serialisation yet as the build pipe line fails due to NO ordering information being generated so the list appears empty at the moment. > or save the ordering information in some other way I did wonder when looking at the generated code, why the content_order_ vector was not serialised along with the data items so it could be extracted on de-serialisation and the information preserved? Thanks, Damon. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 08 September 2016 17:19 To: Southworth Damon (AA-AS/EOS32) Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] XSD Generate Extraction and Ordered Type Hi Damon, Southworth Damon (AA-AS/EOS32) writes: > Manually editing the generated code allowed the binary serialisation > to work correctly. This is actually a lot trickier than that. To preserve element order in binary extraction you first need to insert them in the correct order (or save the ordering information in some other way). I've started working on this and it got pretty hairy very quickly. I will need to think some more on it in the next couple of days. Boris From vsverdlov at transcendinsights.com Wed Sep 14 13:59:48 2016 From: vsverdlov at transcendinsights.com (Vladimir Sverdlov) Date: Wed Sep 14 19:58:39 2016 Subject: [xsd-users] Cannot see/output the hierarchy of the objects Message-ID: Hello, I?ve been evaluating your tool and I encountered some problems generating and visualization the hierarchy of the objects. Through the debugger and outputting the serialized object, I can see the first level hierarchy, but I don?t see anything deeper. In the attachment I included relevant xsd files, driver, and commands to compile. Could you take a look and give some inside? Thank you in advance for your help, Vladimir The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information. -------------- next part -------------- A non-text attachment was scrubbed... Name: codes.tar Type: application/x-tar Size: 147456 bytes Desc: codes.tar Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20160914/16202131/codes-0001.tar From boris at codesynthesis.com Wed Sep 14 20:44:47 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Sep 14 20:44:56 2016 Subject: [xsd-users] Cannot see/output the hierarchy of the objects In-Reply-To: References: Message-ID: Hi Vladimir, Vladimir Sverdlov writes: > Could you take a look and give some inside? You example doesn't include an .xml file so it's hard to figure out what exactly you expect to "see" (also, in your compile command lines there is driver1.cpp while in the archive you have driver2.cpp). But looking through your schemas my guess would be this is a polymorphic object model and you don't "see" things because you are looking in the bases, not in actual derived instances. Check the C++/Tree documentation on how to handle polymorphic schemas. Boris From vsverdlov at transcendinsights.com Thu Sep 15 12:15:21 2016 From: vsverdlov at transcendinsights.com (Vladimir Sverdlov) Date: Thu Sep 15 16:44:39 2016 Subject: [xsd-users] Cannot see/output the hierarchy of the objects In-Reply-To: References: Message-ID: Hi Boris, Thank you very much, that helped greatly! Vladimir On 9/14/16, 5:44 PM, "Boris Kolpackov" wrote: >Hi Vladimir, > >Vladimir Sverdlov writes: > >> Could you take a look and give some inside? > >You example doesn't include an .xml file so it's hard to figure out what >exactly you expect to "see" (also, in your compile command lines there >is driver1.cpp while in the archive you have driver2.cpp). > >But looking through your schemas my guess would be this is a polymorphic >object model and you don't "see" things because you are looking in the >bases, not in actual derived instances. Check the C++/Tree documentation >on how to handle polymorphic schemas. > >Boris The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information. From boris at codesynthesis.com Thu Sep 15 21:36:37 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Sep 16 13:10:13 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> Message-ID: Hi Damon, Sorry for the delay in replying. Southworth Damon (AA-AS/EOS32) writes: > I did wonder when looking at the generated code, why the content_order_ > vector was not serialised along with the data items so it could be > extracted on de-serialisation and the information preserved? Yes, this turned out to be the best option. I've implemented it and would like to build you a pre-release binary so that you can try it out. Can you let me know which platform you need? Boris From damon.southworth at uk.bosch.com Mon Sep 19 06:27:42 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Mon Sep 19 06:27:57 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> Message-ID: <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> Hi Boris, >> content_order_ vector was not serialised along with the data items so >> it could be extracted on de-serialisation and the information preserved? >Yes, this turned out to be the best option. I've implemented it and would like to build you a pre-release binary so that you >can try it out. Can you let me know which platform you need? That's great. It will be easiest for me to test with a Windows build up front but I will need the Linux and OSX platforms too. Regards, Damon. From boris at codesynthesis.com Tue Sep 20 22:34:04 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 20 22:34:16 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> Message-ID: Hi Damon, Here you go: http://codesynthesis.com/~boris/tmp/xsd/xsd-4.1.0.a9-i686-windows.zip Let me know if there are any issues. Boris From damon.southworth at uk.bosch.com Wed Sep 21 04:58:53 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Wed Sep 21 04:59:08 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> Message-ID: <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> Hi Boris, Thanks, for the new version xsd-4.1.0.a9 to test. > Let me know if there are any issues. The first thing I have noticed is that this new version is not generating the _clone method implementation for any of the classes. They are all pure virtual. Are there some configuration differences for this version? Damon. From boris at codesynthesis.com Wed Sep 21 21:05:54 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Sep 21 21:06:06 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> Message-ID: Hi Damon, Southworth Damon (AA-AS/EOS32) writes: > The first thing I have noticed is that this new version is not > generating the _clone method implementation for any of the > classes. They are all pure virtual. Are there some configuration > differences for this version? The new version generates _clone() as pure virtual for abstract (in XML Schema sense) types. Boris From damon.southworth at uk.bosch.com Thu Sep 22 05:49:09 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Thu Sep 22 05:49:24 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> Message-ID: <0831a5d975374dce95a4d0e7fa7e2409@SI-MBX1035.de.bosch.com> Hi Boris, > The new version generates _clone() as pure virtual for abstract (in XML Schema sense) types. Ah yes, that makes sense. So I have looked a bit further now into the compilation problem with the abstract classes generated by this updated compiler. The problem is related to the code generated for the binary deserialization. There is a common block that is generated for de-serializing polymorphic types. I have shown it here with a type of XXX_type. XXX_type is an abstract class. bool d; ::std::unique_ptr< XXX_type > r; s >> d; if (!d) r.reset(new XXX_type(s, f, this)); else { ::std::unique_ptr< ::xsd::cxx::tree::type > tmp( ::xsd::cxx::tree::stream_extraction_map_instance< 0, ACE_InputCDR, char >().extract( s, f, this)); r.reset(dynamic_cast (tmp.get())); if (r.get()) tmp.release(); else throw ::xsd::cxx::tree::not_derived< char >(); } There is a bool that appears to be used to indicate the presence (or not) of a following polymorphic type to be de-serialized. The problem comes in that if it is false then it instantiates a default version of XXX_type rather than the one de-serialized from the stream. However the XXX_type is abstract so it can't be instantiated. In the schema the class member that is being de-serialized is not optional, so there will ALWAYS be one in the stream so the bool should not be required. Regards, Damon. From boris at codesynthesis.com Fri Sep 23 20:59:58 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Sep 23 21:00:11 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: <0831a5d975374dce95a4d0e7fa7e2409@SI-MBX1035.de.bosch.com> References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> <0831a5d975374dce95a4d0e7fa7e2409@SI-MBX1035.de.bosch.com> Message-ID: Hi Damon, Thanks for the analysis. This was a bug in abstract type handling that I now (hopefully) fixed. Can you try this binary and see if there are still any issues: http://codesynthesis.com/~boris/tmp/xsd/xsd-4.1.0.a10-i686-windows.zip Boris From anael.la-fata at capgemini.com Tue Sep 27 04:24:55 2016 From: anael.la-fata at capgemini.com (LA FATA, Anael) Date: Tue Sep 27 04:25:05 2016 Subject: [xsd-users] Question about code synthesis C++/Tree : serialization and XSD patterns Message-ID: Hello, I am currently using code synthesis C++/Tree to create an XML document consistent with a given XSD schema. I could generate without any problem the set of C++ classes with the corresponding serialization methods. The issue I have got is that my XSD file defines patterns for float members such as : "" But in the string stream I get by using the generated serialization method, those patterns are not respected. For instance I will get "0.3" instead of "0.30" for the latest pattern example. Is there any way to force the generated serialization method to be compliant with the XSD constraints patterns ? Best regards, Ana?l La Fata This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. From boris at codesynthesis.com Tue Sep 27 10:48:12 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 27 10:48:22 2016 Subject: [xsd-users] Question about code synthesis C++/Tree : serialization and XSD patterns In-Reply-To: References: Message-ID: Hi Anael, LA FATA, Anael writes: > The issue I have got is that my XSD file defines patterns for float members > such as : "" > > But in the string stream I get by using the generated serialization method, > those patterns are not respected. > > For instance I will get "0.3" instead of "0.30" for the latest pattern > example. > > Is there any way to force the generated serialization method to be > compliant with the XSD constraints patterns? Regex patterns are only used for validation. It is generally impossible to take a pattern and produce output that matches it except by doing an exhaustive search. However, the cxx/tree/custom/double/ example in the XSD distribution shows another way to achieve what you want. Boris From anael.la-fata at capgemini.com Tue Sep 27 11:11:48 2016 From: anael.la-fata at capgemini.com (LA FATA, Anael) Date: Tue Sep 27 11:12:00 2016 Subject: [xsd-users] Question about code synthesis C++/Tree : serialization and XSD patterns In-Reply-To: References: Message-ID: Hi and thank you very much for your answer. If I understand you well, I have no other solution that redefining << operators for each type that has a specific pattern ? There is no "generic" solution that could work for any XSD file (since I have several XSD and they might change in the future) ? Ana?l -----Message d'origine----- De?: Boris Kolpackov [mailto:boris@codesynthesis.com] Envoy??: mardi 27 septembre 2016 16:48 ??: LA FATA, Anael Cc?: xsd-users@codesynthesis.com Objet?: Re: [xsd-users] Question about code synthesis C++/Tree : serialization and XSD patterns Hi Anael, LA FATA, Anael writes: > The issue I have got is that my XSD file defines patterns for float > members such as : "" > > But in the string stream I get by using the generated serialization > method, those patterns are not respected. > > For instance I will get "0.3" instead of "0.30" for the latest pattern > example. > > Is there any way to force the generated serialization method to be > compliant with the XSD constraints patterns? Regex patterns are only used for validation. It is generally impossible to take a pattern and produce output that matches it except by doing an exhaustive search. However, the cxx/tree/custom/double/ example in the XSD distribution shows another way to achieve what you want. Boris This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. From boris at codesynthesis.com Wed Sep 28 12:49:15 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Sep 28 12:49:25 2016 Subject: [xsd-users] Question about code synthesis C++/Tree : serialization and XSD patterns In-Reply-To: References: Message-ID: Hi Anael, LA FATA, Anael writes: > Hi and thank you very much for your answer. > > If I understand you well, I have no other solution that redefining << > operators for each type that has a specific pattern? There is no "generic" > solution that could work for any XSD file (since I have several XSD and > they might change in the future)? No, if you want trailing zeros, there is no XML Schema-base solution. The README for the example states this explicitly: "In case we can modify the schema, a better approach would be to define the price type as a restriction of the xsd:decimal type (always fixed notation) and specify the fractionDigits facet to limit the number of fraction digits to 2. However, there is no way in XML Schema to specify that there should always be exactly 2 fraction digits. Therefore, it may still be desirable to customize this price type to get the required serialization behavior." Boris From damon.southworth at uk.bosch.com Wed Sep 28 22:03:53 2016 From: damon.southworth at uk.bosch.com (Southworth Damon (AA-AS/EOS32)) Date: Wed Sep 28 22:04:08 2016 Subject: [xsd-users] XSD Generate Extraction and Ordered Type In-Reply-To: References: <1f652bb838fe4dcfa518ef4b7d44108e@SI-MBX1035.de.bosch.com> <2cea9a22c83043d6bc8d37cbabb09f00@FE-MBX1036.de.bosch.com> <5b7c0ffdd4c54a7582a454356674bc2e@FE-MBX1036.de.bosch.com> <0831a5d975374dce95a4d0e7fa7e2409@SI-MBX1035.de.bosch.com> Message-ID: <2c6dc54b89f84f52860b112368b174c6@SI-MBX1035.de.bosch.com> Hi Boris, > Thanks for the analysis. This was a bug in abstract type handling that I now (hopefully) fixed. Can you try this binary and see if there are still any issues: Thanks for update. It all now looks good. This new version is now producing code that compiles and from initial tests it looks like the ordered data type information is being preserved on binary deserialization. I will now integrate this into our build system and confirm that it works correctly with the unit and integration tests. Regards, Damon.