From boris at codesynthesis.com Mon Apr 1 09:37:51 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Apr 1 09:55:43 2019 Subject: [xsde-users] Controlling double precision for xs:decimal In-Reply-To: References: Message-ID: Andrea Tessadri writes: > The result of the serialization for: > Latitude().base_value(-83.12345); > > will be: > > -83.123450000000005 > > How to control double precision ? You can either configure the built-in decimal serializer or provide your own. See "Floating-Point Type Serializers": https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#7.1 BTW, please don't post new questions by replying to an existing email since this breaks threading. See Posting Guidelines for this and other points: https://codesynthesis.com/support/posting-guidelines.xhtml From tessadriandrea at gmail.com Tue Apr 2 05:14:34 2019 From: tessadriandrea at gmail.com (Andrea Tessadri) Date: Wed Apr 3 08:04:03 2019 Subject: [xsde-users] Link generated parser and serializer to a wildcard xs.any element Message-ID: In a communication protocol I have a message description xsd containing a payload defined as xs:any like this: I have also several xsd files describing how the payload should be. Let's say one of them is a heartbeat message like this What I would like to do is to link the serializer of the heartbeat xsd to the payload of the message when I am preparing a message carrying a heartbeat as payload. This case seems different from wildcard examples since I don't need to create my own serializer for the wildcard. I just would like to bind the already generated serial to the particular instance of the message carrying the heartbeat. From tessadriandrea at gmail.com Wed Apr 3 03:54:25 2019 From: tessadriandrea at gmail.com (Andrea Tessadri) Date: Wed Apr 3 08:04:03 2019 Subject: [xsde-users] Controlling double precision for xs:decimal In-Reply-To: References: Message-ID: Since I am using cxx-hybrid I already have the serializer for the simpleType Latituide generated by XSDe in the -simpl.hxx file class LatitudeType_simpl: public LatitudeType_sskel { public: LatitudeType_simpl (); virtual void pre (const ::LatitudeType&); public: ::xml_schema::decimal_simpl base_impl_; }; Also, this serializer is already assigned to every aggregate type _saggr corresponding to every object that is using the Latitude tag. How to configure the precision of the Latitude tag (in every object using it) leaving untouched other elements based on ::xml_schema::decimal_simpl ? Of course, I wouldn't like to change the generated code. On Mon, Apr 1, 2019 at 3:37 PM Boris Kolpackov wrote: > Andrea Tessadri writes: > > > The result of the serialization for: > > Latitude().base_value(-83.12345); > > > > will be: > > > > -83.123450000000005 > > > > How to control double precision ? > > You can either configure the built-in decimal serializer or provide your > own. See "Floating-Point Type Serializers": > > > https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#7.1 > > BTW, please don't post new questions by replying to an existing email > since this breaks threading. See Posting Guidelines for this and other > points: > > https://codesynthesis.com/support/posting-guidelines.xhtml > From kelvinmanoj at gmail.com Thu Apr 4 07:21:02 2019 From: kelvinmanoj at gmail.com (kelvin manoj) Date: Thu Apr 4 07:39:45 2019 Subject: [xsde-users] Migration from XSD to XSD/e Message-ID: Hi, I am trying to migrate from XSD to XSD/e for the below project available in github. This I am doing for reducing the memory usage. XSD consuming lot of memory with xerces. So I believe if I migrate the project to XSD/e I can save some memory. Is it possible to migrate the XSD to XSD/e if some application already using XSD. I don't wanted to modify the application code. Project I am trying to migrate: https://github.com/epri-dev/OpenADR-VEN-Library I have compiled the schema files using XSD/e but after including in the project I am seeing lot of things are missing. Some places where I am getting errors commonly are given below. XSD: typedef ::icalendar_2_0::DateTimeType date_time_type; XSD/e: Here there is no such inner typedef. So I am getting bellow error while building my application error C2039: 'date_time_type' : is not a member of 'icalendar_2_0::dtstart' If I try to resolve the above error by replacing the date_time_type with ::icalendar_2_0::DateTimeType I am getting below issue related to that. XSD: template inline date_time:: date_time (int year, unsigned short month, unsigned short day, unsigned short hours, unsigned short minutes, double seconds, short zone_h, short zone_m) : time_zone (zone_h, zone_m), year_ (year), month_ (month), day_ (day), hours_ (hours), minutes_ (minutes), seconds_ (seconds) { } XSD/e: inline date_time:: date_time (int year, unsigned short month, unsigned short day, unsigned short hours, unsigned short minutes, double seconds, short zone_h, short zone_m) : time_zone (zone_h, zone_m), year_ (year), month_ (month), day_ (day), hours_ (hours), minutes_ (minutes), seconds_ (seconds) { } Here template is missing so it throws below error error C2664: 'icalendar_2_0::DateTimeType::DateTimeType(const icalendar_2_0::DateTimeType &)' : cannot convert argument 1 from 'xsde::cxx::date_time' to 'const icalendar_2_0::DateTimeType &' I am not sure If i am missing any options in the compile command. Here is the command I used to compile: xsde cxx-hybrid --root-element oadrPayload --file-per-type --generate-parser --generate-serializer --generate-polymorphic --polymorphic-type ItemBaseType --polymorphic-type EnergyItemType --polymorphic-type PowerItemType --polymorphic-type PayloadBaseType --polymorphic-type StreamPayloadBaseType --polymorphic-type UidType --output-dir ../2b/ --namespace-map http://openadr.org/oadr-2.0b/2012/07=oadr2b::oadr --namespace-map http://docs.oasis-open.org/ns/energyinterop/201110=oadr2b::ei --namespace-map http://www.opengis.net/gml/3.2=oadr2b::gml --namespace-map http://docs.oasis-open.org/ns/emix/2011/06=oadr2b::emix --namespace-map http://www.w3.org/2009/xmldsig11#=oadr2b::dsig11 --namespace-map http://www.w3.org/2000/09/xmldsig#=oadr2b::sig --namespace-map http://openadr.org/oadr-2.0b/2012/07/xmldsig-properties=oadr2b::dsp oadr_20b.xsd oadr_atom.xsd oadr_ei_20b.xsd oadr_emix_20b.xsd oadr_gml_20b.xsd oadr_greenbutton.xsd oadr_ISO_ISO3AlphaCurrencyCode_20100407.xsd oadr_power_20b.xsd oadr_pyld_20b.xsd oadr_siscale_20b.xsd oadr_strm_20b.xsd oadr_xcal_20b.xsd oadr_xml.xsd oadr_xmldsig-properties-schema.xsd oadr_xmldsig.xsd oadr_xmldsig11.xsd -- Regards, J.Kelvin Manoj Chennai. 9940522974. From boris at codesynthesis.com Fri Apr 5 07:11:04 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Apr 5 07:29:09 2019 Subject: [xsde-users] Migration from XSD to XSD/e In-Reply-To: References: Message-ID: kelvin manoj writes: > I am trying to migrate from XSD to XSD/e for the below project available in > github. This I am doing for reducing the memory usage. XSD consuming lot of > memory with xerces. > > So I believe if I migrate the project to XSD/e I can save some memory. If the large memory consumption is due to loading of large XML files, then streaming parsing/serialization in XSD might be a simpler solution. See the 'streaming' example in examples/cxx/tree/. > Is it possible to migrate the XSD to XSD/e if some application already > using XSD. I don't wanted to modify the application code. No, XSD and XSD/e have entirely different mappings (with different trade- offs and benefits). You will most likely have to modify every part of your application that deals with the object model. From Michael.Deakin at uk.thalesgroup.com Mon Apr 8 12:49:21 2019 From: Michael.Deakin at uk.thalesgroup.com (DEAKIN Micheal - CONTRACTOR) Date: Tue Apr 9 05:43:20 2019 Subject: [xsde-users] C++ Serialization of Date_Time Message-ID: When I attempt to serialise the following string with a time starting with "00" hours an exception is raised. 2019-03-31 00:05:55.108 Calling the serialize with any the hours field of the anything but "00" works correctly. Thanks Michael Deakin From boris at codesynthesis.com Tue Apr 9 09:04:47 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Apr 9 09:23:03 2019 Subject: [xsde-users] C++ Serialization of Date_Time In-Reply-To: References: Message-ID: DEAKIN Micheal - CONTRACTOR writes: > When I attempt to serialise the following string with a time starting > with "00" hours an exception is raised. > > 2019-03-31 00:05:55.108 > > Calling the serialize with any the hours field of the anything but "00" > works correctly. You will need to provide more details than that: what exception is thrown (including the message), what is the you code doing when that happens (a code fragment is best). From kelvinmanoj at gmail.com Thu Apr 25 01:32:00 2019 From: kelvinmanoj at gmail.com (kelvin manoj) Date: Thu Apr 25 01:51:49 2019 Subject: [xsde-users] Migration from XSD to XSD/e In-Reply-To: References: Message-ID: Hi Boris, Thank a lot for clarifying my question. I have few more questions. I wanted to understand that what will be the percentage of memory footprint will be saved if we go for XSD/e from XSD. Will XSD/e generates code is C++11 standard ?? Is there any way to use some lightweight XML validator insted of xerces? we feel xerces is too heavy for us and some light weight parser will save us some memory. ---------- Forwarded message --------- From: Boris Kolpackov Date: Fri, Apr 5, 2019 at 4:41 PM Subject: Re: [xsde-users] Migration from XSD to XSD/e To: kelvin manoj Cc: kelvin manoj writes: > I am trying to migrate from XSD to XSD/e for the below project available in > github. This I am doing for reducing the memory usage. XSD consuming lot of > memory with xerces. > > So I believe if I migrate the project to XSD/e I can save some memory. If the large memory consumption is due to loading of large XML files, then streaming parsing/serialization in XSD might be a simpler solution. See the 'streaming' example in examples/cxx/tree/. > Is it possible to migrate the XSD to XSD/e if some application already > using XSD. I don't wanted to modify the application code. No, XSD and XSD/e have entirely different mappings (with different trade- offs and benefits). You will most likely have to modify every part of your application that deals with the object model.