From dpreynolds at srcinc.com Thu Dec 4 14:02:53 2014 From: dpreynolds at srcinc.com (Reynolds, David) Date: Fri Dec 5 06:31:50 2014 Subject: [xsde-users] Enhancement request: support default property Message-ID: <201412041903.sB4J30Ei006980@codesynthesis.com> Right now, the default property is ignored when the code is generated. It would be convenient to have the variable initialized with the default value (if supplied) at construction time. For example: Would pre-fill the 'Mode' element with a value of 3 whenever a LinkSettings object was created. Best regards, Dave. From dpreynolds at srcinc.com Thu Dec 4 14:08:31 2014 From: dpreynolds at srcinc.com (Reynolds, David) Date: Fri Dec 5 06:31:50 2014 Subject: [xsde-users] Feature request: "Short" closing of elements that only have attributes Message-ID: <201412041908.sB4J8cFB007512@codesynthesis.com> Consider the following Cursor-On-Target snippet, as serialized by XSD/e using the built-in serializers: It would be nice if the library recognized that the element consisted of only attributes and therefore could use the shorter closing sequence: Best regards, Dave. From boris at codesynthesis.com Mon Dec 8 06:53:46 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 8 07:02:18 2014 Subject: [xsde-users] Enhancement request: support default property In-Reply-To: <201412041903.sB4J30Ei006980@codesynthesis.com> References: <201412041903.sB4J30Ei006980@codesynthesis.com> Message-ID: Hi David, Reynolds, David writes: > Right now, the default property is ignored when the code is generated. > It would be convenient to have the variable initialized with the default > value (if supplied) at construction time. For example: > > > > > > I've added this to the TODO list, thanks for the suggestion. Note, however, that XSD/e won't be able to do this always. For example, if the element type is std::string and you have exceptions disables, then there is no way to initialize the default value in the constructor (no way to report the allocation error). Boris From boris at codesynthesis.com Mon Dec 8 06:57:09 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 8 07:05:42 2014 Subject: [xsde-users] Feature request: "Short" closing of elements that only have attributes In-Reply-To: <201412041908.sB4J8cFB007512@codesynthesis.com> References: <201412041908.sB4J8cFB007512@codesynthesis.com> Message-ID: Hi David, Reynolds, David writes: > It would be nice if the library recognized that the element consisted > of only attributes and therefore could use the shorter closing sequence: I we have this implemented for the next release. Let me know if you would like me to send you a pre-release so that you can start using this. Boris From jdattolo at dekaresearch.com Mon Dec 29 20:35:16 2014 From: jdattolo at dekaresearch.com (Jim Dattolo) Date: Mon Dec 29 20:35:27 2014 Subject: [xsde-users] custom binary encoding Message-ID: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F0D@dekaexchange07.deka.local> Resending as I didn't see the post make it to the list... I'm currently in the custom binary example code and I am a little confused about something. I want to encode my classes down to binary, however I want to strip off the attributes. We use attributes to give hints to various pieces of code on how to manage special cases (python through pyxb and java through JAXB), in every case they are set to default values and never change. An example would be flags to give hints to the UI as to what color to display the data in, or to set the command priority for use in later queues. The current binary protocol (which cannot be changed) doesn't allow for transport of the attributes as both sides already agree what they will be for the various docs, default values in the XSD which both sides compile into their own language. I see the code generated by the compiler adds in support to stream out and in the attributes. I really don't want to have to write script to alter the compiler output to remove the lines of code that were generated to do this. Is there any way to filter them out or add an option to the compiler to ignore attributes? I see a lot of source for using the results of xsde, just not the source for the compiler itself? Any pointers to start down this path? Also I need to change the endian order for the binary for all datatypes. Not all data types are setup in the raw stream code, is it as simple as overriding for all of the missing data types and changing the stream type to little endian? -Jim ________________________________ This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message. Thank you. Please consider the environment before printing this email. From jdattolo at dekaresearch.com Mon Dec 29 21:22:10 2014 From: jdattolo at dekaresearch.com (Jim Dattolo) Date: Mon Dec 29 21:22:18 2014 Subject: [xsde-users] possible bug or misunderstanding/setup issue? Message-ID: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F13@dekaexchange07.deka.local> I am building up some code from a set of very simple XSD files and I am noticing that inner simple anon types are being instantiated at the upper level and are colliding when linked. Here are the two xsd files: ****** from TestClass1Type.xsd **************** ****** from TestClass2Type.xsd **************** In both .cxx/.ixx files a class is made at the upper level like so: // InnerSimpleType // InnerSimpleType:: InnerSimpleType () { } Which then collides at the linker. Why are the anon types being called by the local name in the .cxx file at the definition time and not a class name with a incrementing number in it which then is referenced in the upper class by the local name? pyxb uses STD_ANON_XXX for them. Both inner anon simple types are _different_ yet the code that is generated is the same, neither have any of the facets for the min/max. This is the same basic xsd structure that is working in both pyxb as well as jaxb. Is there a xsde compiler switch/option that I am lacking? I have been basing my builds out of the custom binary hybrid makefile. My goal is to only use the binary stream part of the system and none of the xml parsing/serialization (that is being handled in pyxb and jaxb.) This code just handles binary packets based on the XSD definitions. I don't believe that I need the full blown XSD compiler, is it possible that only the full version will support encapsulating inner anon types with the same names? -Jim ________________________________ This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message. Thank you. Please consider the environment before printing this email. From boris at codesynthesis.com Tue Dec 30 09:28:43 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 30 09:25:10 2014 Subject: [xsde-users] possible bug or misunderstanding/setup issue? In-Reply-To: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F13@dekaexchange07.deka.local> References: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F13@dekaexchange07.deka.local> Message-ID: <20141230142843.GA24570@codesynthesis.com> Hi Jim, Jim Dattolo writes: > Why are the anon types being called by the local name in the .cxx file > at the definition time and not a class name with a incrementing number > in it which then is referenced in the upper class by the local name? Because that would be ugly ;-). > Is there a xsde compiler switch/option that I am lacking? Yes, it is called --anonymous-regex. The compiler manual has more information on it: http://www.codesynthesis.com/projects/xsde/documentation/xsde.xhtml A regex like this should do the trick in your case: %.* .* (.+/)*(.+)%$1$2% Boris From boris at codesynthesis.com Tue Dec 30 09:54:16 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 30 09:50:46 2014 Subject: [xsde-users] custom binary encoding In-Reply-To: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F0D@dekaexchange07.deka.local> References: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F0D@dekaexchange07.deka.local> Message-ID: Hi Jim, Jim Dattolo writes: > I want to encode my classes down to binary, however I want to strip off the > attributes. [...] Is there any way to filter them out or add an option > to the compiler to ignore attributes? Customizing the XSD/e compiler is definitely possible but to me a much easier way would be to strip the attributes from the schema (e.g., with an XSLT transformation or some such). I may be wrong but from your description it seems that the attributes in your schema are there just for decoration. Their values are fixed and known to all the parties involved. > I see a lot of source for using the results of xsde, just not the > source for the compiler itself? It is right here: http://codesynthesis.com/projects/xsde/ > Any pointers to start down this path? Uh, the trickiest part will be building it, especially if you are on Windows. In fact, if you do want to go down this path, it will probably be better for you to start with the current pre-release; the build system has been improved there somewhat. Customizing the source code itself will be fairly easy. > Also I need to change the endian order for the binary for all > datatypes. Not all data types are setup in the raw stream > code, is it as simple as overriding for all of the missing > data types and changing the stream type to little endian? Yes, the way you would want to handle this is to implement your own binary representation streams, just like the 'binary/custom' example. One last note: you said that the binary protocol is fixed and cannot be changed. While you can change how XSD/e serializes basic types (integers, string, etc.; via the binary stream), you cannot change how or in which order it serializes higher- level constructs, such as optional/sequences of elements, etc. For example, for an optional element, XSD/e will first write a boolean flag and then the element itself. For a sequence of elements it will write the count first followed by all the elements. Things get less "standard" for choice, for example. So unless all of this happens to match your binary format, you will run into trouble that would require further, potentially significant, customizations of the XSD/e compiler. Boris From jdattolo at dekaresearch.com Wed Dec 31 11:48:24 2014 From: jdattolo at dekaresearch.com (Jim Dattolo) Date: Wed Dec 31 11:48:34 2014 Subject: [xsde-users] custom binary encoding In-Reply-To: References: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F0D@dekaexchange07.deka.local> Message-ID: <0A40042D85E7C84DB443060EC44B3FD36D9A9B8B9C@dekaexchange07.deka.local> The attributes are used throughout the project where JAVA and Python are used as in both of those cases we use the attributes for hints on how to manage binary data as well as in filters. Going back though things I now see that I need to manage the attributes even on the C side as the binary protocol has arbitrary length ints such as a uintle:3 (little endian 3 bit unsigned integer) We don't use any optionals, everything is mandatory and everything is in a sequence for our system. It sounds like I need to get into the compiler since I can't have any of the attributes being serialized. -Jim -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Tuesday, December 30, 2014 9:54 AM To: Jim Dattolo Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] custom binary encoding Hi Jim, Jim Dattolo writes: > I want to encode my classes down to binary, however I want to strip off the > attributes. [...] Is there any way to filter them out or add an option > to the compiler to ignore attributes? Customizing the XSD/e compiler is definitely possible but to me a much easier way would be to strip the attributes from the schema (e.g., with an XSLT transformation or some such). I may be wrong but from your description it seems that the attributes in your schema are there just for decoration. Their values are fixed and known to all the parties involved. > I see a lot of source for using the results of xsde, just not the > source for the compiler itself? It is right here: http://codesynthesis.com/projects/xsde/ > Any pointers to start down this path? Uh, the trickiest part will be building it, especially if you are on Windows. In fact, if you do want to go down this path, it will probably be better for you to start with the current pre-release; the build system has been improved there somewhat. Customizing the source code itself will be fairly easy. > Also I need to change the endian order for the binary for all > datatypes. Not all data types are setup in the raw stream > code, is it as simple as overriding for all of the missing > data types and changing the stream type to little endian? Yes, the way you would want to handle this is to implement your own binary representation streams, just like the 'binary/custom' example. One last note: you said that the binary protocol is fixed and cannot be changed. While you can change how XSD/e serializes basic types (integers, string, etc.; via the binary stream), you cannot change how or in which order it serializes higher- level constructs, such as optional/sequences of elements, etc. For example, for an optional element, XSD/e will first write a boolean flag and then the element itself. For a sequence of elements it will write the count first followed by all the elements. Things get less "standard" for choice, for example. So unless all of this happens to match your binary format, you will run into trouble that would require further, potentially significant, customizations of the XSD/e compiler. Boris Click https://www.mailcontrol.com/sr/sfyoK8xrtljGX2PQPOmvUjg7ce8j6mWJ7fXiyPMP0Ma07o21biqxBeq3xJd77evTfRb1JLBUB+nCP4z!bwErJQ== to report this email as spam. This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message. Thank you. Please consider the environment before printing this email. From jdattolo at dekaresearch.com Wed Dec 31 11:52:51 2014 From: jdattolo at dekaresearch.com (Jim Dattolo) Date: Wed Dec 31 11:52:59 2014 Subject: [xsde-users] possible bug or misunderstanding/setup issue? In-Reply-To: <20141230142843.GA24570@codesynthesis.com> References: <0A40042D85E7C84DB443060EC44B3FD36D9A9B7F13@dekaexchange07.deka.local> <20141230142843.GA24570@codesynthesis.com> Message-ID: <0A40042D85E7C84DB443060EC44B3FD36D9A9B8BA6@dekaexchange07.deka.local> Boris, Thanks for the quick replies! I don't see how a local anon type can be placed in the global scope as that pretty much guarantees name collisions. At a minimum I would expect the class to be inside the other class to keep collisions from happening (at least there is a XSD requirement for unique member element names) I'll look into the --anonymous-regex option, thanks! -Jim -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Tuesday, December 30, 2014 9:29 AM To: Jim Dattolo Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] possible bug or misunderstanding/setup issue? Hi Jim, Jim Dattolo writes: > Why are the anon types being called by the local name in the .cxx file > at the definition time and not a class name with a incrementing number > in it which then is referenced in the upper class by the local name? Because that would be ugly ;-). > Is there a xsde compiler switch/option that I am lacking? Yes, it is called --anonymous-regex. The compiler manual has more information on it: http://www.codesynthesis.com/projects/xsde/documentation/xsde.xhtml A regex like this should do the trick in your case: %.* .* (.+/)*(.+)%$1$2% Boris Click https://www.mailcontrol.com/sr/44LJ7OSEfzDGX2PQPOmvUkWM85sEKD4+JQp9f4RkIBMf+uAXoUIEnD7A9mDGuwKhfRb1JLBUB+nCP4z!bwErJQ== to report this email as spam. This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message. Thank you. Please consider the environment before printing this email.