From matthias.maschek at uma.at Fri Jun 1 05:39:58 2012 From: matthias.maschek at uma.at (Matthias Maschek) Date: Fri Jun 1 05:40:08 2012 Subject: [xsde-users] Problems with Windows 64bit application Message-ID: <4FC88DEE.1020808@uma.at> Hello! I get the following error: The generated Code uses long long while the XSDe runtime does not. I generated the code on a Linux64bit, but now i try to use it as is on Windows 64 bit in an 64 bit application. Do i have to recompile the whole runtime from XSDe from scratch in 64 bit so that it works? For now I just compiled it in an 64bit environment through the standard toolset. Thanks, Matthias Maschek -- uma ? separating the signal from the noise matthias.maschek . developer . matthias.maschek@uma.at phone +43 1 526 29 67-0 . fax +43-1-526 29 67-200 uma information technology GmbH . zollergasse 9-11 . a-1070 vienna http://www.uma.at http://www.facebook.com/umavienna http://www.youtube.com/user/umavienna -- Diese E-Mail enth?lt vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From boris at codesynthesis.com Fri Jun 1 11:33:57 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jun 1 11:34:04 2012 Subject: [xsde-users] Problems with Windows 64bit application In-Reply-To: <4FC88DEE.1020808@uma.at> References: <4FC88DEE.1020808@uma.at> Message-ID: Hi Matthias, Matthias Maschek writes: > I get the following error: > The generated Code uses long long while the XSDe runtime does not. > > I generated the code on a Linux64bit, but now i try to use it as is on > Windows 64 bit in an 64 bit application. > Do i have to recompile the whole runtime from XSDe from scratch in 64 > bit so that it works? Support for long long is optional in XSD/e and is controlled with the XSDE_LONGLONG parameter in config.make/config.nmake. If this support is enabled, then the C++ compiler must support the long long type and the C runtime must provide the strtoull() function. On Linux, both of these conditions are met so support for long long is enabled by default. On Windows, while long long is supported by newer versions of VC++, strtoull() is still not available. So on Windows long long support is disabled. You have two ways to resolve your problem: 1. You can keep the Linux XSD/e runtime configured with long long enabled but will need to compile generated code differently for Windows (add --no-long-long option). 2. Alternatively, if you want to use the same generated code on both Linux and Windows, then you will need to re-configure and re-build the Linux XSD/e runtime not to use long long (set XSDE_LONGLONG to 'n' in config.make). You will also need to compile your schemas with the --no-long-long option. I would recommend that you go with approach #2 since it is more consistent. Boris From ivan.lelann at free.fr Tue Jun 5 11:47:42 2012 From: ivan.lelann at free.fr (Ivan Le Lann) Date: Tue Jun 5 11:47:53 2012 Subject: [xsde-users] add suffix to attribute getter/setter In-Reply-To: Message-ID: <1491322767.183202804.1338911262467.JavaMail.root@zimbra28-e5.priv.proxad.net> ----- Mail original ----- > De: "Boris Kolpackov" > ?: "Ivan Le Lann" > Cc: xsde-users@codesynthesis.com > Envoy?: Mercredi 30 Mai 2012 16:06:01 > Objet: Re: [xsde-users] add suffix to attribute getter/setter > > Hi Ivan, > > Ivan Le Lann writes: > > > Is there a way with XSDe/Hybrid to control generated getter/setter > > method names for attributes ? (without changing the xsd attribute > > name, obviously) > > > > > > > > > > > > would give getter/setter "Name__attr" instead of "Name". > > No, there is currently no such mechanism. If the names of attributes > in your schema are not used for any other constructs (e.g., type or > element names), then you could achieve this using the --reserved-name > option. For example: > > --reserved-name Name=Name__attr > > You could probably generate an options file with a list of these > options for all of your attributes with a simple sed script. > Thanks for your answer, but that won't work in my case. Names do clash. Anyway, this was only a nice feature to have, nothing necessary. I'll forget it for now. Regards, Ivan From nikita_visnevski at hotmail.com Mon Jun 18 14:20:07 2012 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Mon Jun 18 14:20:15 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. Message-ID: Does xsde generate support for polymorphic data model loading and saving through binary representation? I tried using the orawstream and irawstream classes supplied in the examples and they worked great until I tried to serialize a data model that came from a schema that contained polymorphic definitions. The schema uses extensions to support polymorphism, and the generated xsde binding does not seem to accommodate for any polymorphism in the operator<<(orawstream& s, ...) definitions. Consequently, I can parse xml files containing polymorphic data structures and serialize them to textual xml representation perfectly well, but the moment I try to do binary serialization, all the extended objects are simply ignored in the resulting binary output. Is this something that has not yet been implemented by the xsde compiler, or am I missing something in the way I generate the binding? Thanks Nikita From nikita_visnevski at hotmail.com Mon Jun 18 16:31:19 2012 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Tue Jun 19 01:59:52 2012 Subject: [xsde-users] Serialization crashes for data model constructed from multiple xsd files Message-ID: I am experiencing a strange crash in the serialization that I am attributing to the fact that my data model is defined in 2 separate xsd files. My first file contains a set of object definitions which is used by multiple other xsd files. My second file includes the first to define some additional data structures and a root element. I have an xml file that is constructed using objects in the second schema file. I am trying to parse this xml file, inspect the resulting data model, and then serialize it back to the screen. Parsing works flawlessly and inspection of the data model shows that all the data is in order. When I attempt serialization, I get a hard crash with unhandled exception - access violation. The crash happens in in the serializer_base::_set_type method. If I move all the definitions to a single xsd file, the problem goes away. This is a little help to me since these schema files will eventually be auto-generated from a third party software, and I cannot force it to only use 1 xsd file. I am attaching the schema files, the xml file and the c++ code segment that illustrates the problem. Any idea is much appreciated. Nikita 1. Here is the driver c++ code: #include "SignalManipulationModel.hxx" #include "SignalManipulationModel-pimpl.hxx" #include "SignalManipulationModel-pskel.hxx" #include "SignalManipulationModel-simpl.hxx" #include "SignalManipulationModel-sskel.hxx" #include "SignalOperationModel.hxx" #include "SignalOperationModel-pimpl.hxx" #include "SignalOperationModel-pskel.hxx" #include "SignalOperationModel-simpl.hxx" #include "SignalOperationModel-sskel.hxx" using namespace Simulation::AeroSim::SignalManipulationModel; using namespace Simulation::AeroSim::SignalOperationModel; ... // Parsing XML to object model SignalOperationList_paggr sol_p; xml_schema::document_pimpl doc_p (sol_p.root_parser (), sol_p.root_namespace (), sol_p.root_name (), true); sol_p.pre (); doc_p.parse (fileName); std::auto_ptr sol (sol_p.post ()); // Inspecting content for(SignalOperationList::operation_iterator i = sol->operation().begin(); i != sol->operation().end(); i++) { SignalOperation& so = *i; OperationDescriptor& sod = so.operationDesc(); ActionDescriptor& ad = so.actionDesc(); cout << so.signalID() << endl; if (SignalAlterationDescriptor* sad = dynamic_cast(&sod)) { cout << "Signal alteration operation" << endl; cout << "Fault activation Cmd : " << sad->faultActivationCmd() << endl; cout << "Bias activation Cmd : " << sad->biasActivationCmd() << endl; cout << "Noise activation Cmd : " << sad->noiseActivationCmd() << endl; AlterationConfigContainer& acc = sad->configContainer(); cout << "Fault value : " << acc.faultValue() << endl; cout << "Fault ramp time : " << acc.faultRampTime() << endl; cout << "Bias value : " << acc.biasValue() << endl; cout << "Bias ramp time : " << acc.biasRampTime() << endl; cout << "Noise STD : " << acc.noiseSTD() << endl; } else if (SignalLoggingDescriptor* sld = dynamic_cast(&sod)) { cout << "Signal logging operation" << endl; cout << "Logging activation Cmd : " << sld->logActivationCmd() << endl; LoggingConfigContainer& lcc = sld->configContainer(); cout << "Log sampling : " << lcc.logSampling() << endl; } else if (SignalTriggerDescriptor* std = dynamic_cast(&sod)) { cout << "Signal triggering operation" << endl; cout << "Trigger activation Cmd : " << std->triggerActivationCmd() << endl; TriggeringConfigContainer& tcc = std->configContainer(); cout << "Reference value : " << tcc.referenceValue() << endl; cout << "Trigger type : " << tcc.triggerType() << endl; } if (ImmediateAction* ia = dynamic_cast(&ad)) { cout << "Immediate action" << endl; } else if (TimedAction* ta = dynamic_cast(&ad)) { cout << "Timed action" << endl; cout << "Is relative : " << ta->relative() << endl; cout << "Time : " << ta->relative() << endl; } else if (TriggeredAction* tra = dynamic_cast(&ad)) { cout << "Triggered action" << endl; cout << "Trigger list : "; TriggeredAction::triggerList_sequence& tls = tra->triggerList(); for (TriggeredAction::triggerList_iterator j = tls.begin(); j != tls.end(); j++ ) { cout << *j << ""; } cout << endl; } } // Serializing the object model SignalOperationList_saggr sol_s; xml_schema::document_simpl doc_s (sol_s.root_serializer (), sol_s.root_namespace(), sol_s.root_name (), true); sol_s.pre (*sol); doc_s.serialize (cout, xml_schema::document_simpl::pretty_print); sol_s.post (); 2. Here is my xml file. ACTIVATE ACTIVATE ACTIVATE_DEFAULT ACTIVATE_DEFAULT CLEAR ACTIVATE_DEFAULT ACTIVATE_DEFAULT ACTIVATE_DEFAULT ACTIVATE ACTIVATE_DEFAULT ACTIVATE Signal4 3. Here is 4. Here is the ( a little big, but really quite simple) From boris at codesynthesis.com Tue Jun 19 09:02:52 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 19 08:58:25 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > Does xsde generate support for polymorphic data model loading and > saving through binary representation? No. We support polymorphic binary representation in XSD but not yet in XSD/e. Boris From boris at codesynthesis.com Tue Jun 19 09:08:21 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 19 09:03:53 2012 Subject: [xsde-users] Serialization crashes for data model constructed from multiple xsd files In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > When I attempt serialization, I get a hard crash with unhandled exception > - access violation. The crash happens in in the > serializer_base::_set_type method. > > If I move all the definitions to a single xsd file, the problem goes away. This is most likely due to the XSD/e compiler not "seeing" all the derivations of a polymorphic hierarchy when generating aggregates. This can be resolved with the --polymorphic-schema option. See Section 3.7, "Support for Polymorphism" in the C++/Hybrid Mapping Getting Started Guide for details. Boris From nikita_visnevski at hotmail.com Tue Jun 19 10:30:51 2012 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Tue Jun 19 10:30:59 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. In-Reply-To: References: , Message-ID: Boris, thanks for your response. Are there plans to support this feature in XSDe? If so, what would be the time frame? Any recommendation on what I can do in the meantime? I guess I can try to implement a subset of this capability manually, though it sounds like a bit of a tedious and daunting task. Thanks again. Nikita > Date: Tue, 19 Jun 2012 15:02:52 +0200 > From: boris@codesynthesis.com > To: nikita_visnevski@hotmail.com > CC: xsde-users@codesynthesis.com > Subject: Re: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. > > Hi Nikita, > > Nikita Visnevski writes: > > > Does xsde generate support for polymorphic data model loading and > > saving through binary representation? > > No. We support polymorphic binary representation in XSD but not yet > in XSD/e. > > Boris From boris at codesynthesis.com Wed Jun 20 09:44:52 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jun 20 09:40:10 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > Are there plans to support this feature in XSDe? If so, what would be > the time frame? It is on our "possible new features" list, however, it doesn't seem like something that a lot of people are interested in. In fact, you are the first person asking for this functionality. So at the moment we have no plans to implement it any time soon. Having said that, if you/your company needs it, we can consider doing this work as custom development on commercial basis. In fact, if I remember correctly, the same was implemented in XSD this way. That is, someone needed it in their application and they paid for its implementation. Contact me off-list if you are interested. > Any recommendation on what I can do in the meantime? I guess I can try > to implement a subset of this capability manually, though it sounds like > a bit of a tedious and daunting task. Yes, the easiest way is probably to implement it properly in the compiler (XSD/e). The other way would be to customize every polymorphic type in your schema and provide custom insertion/extraction operators that handle polymorphism. Boris From nikita_visnevski at hotmail.com Wed Jun 20 11:09:30 2012 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Wed Jun 20 11:09:45 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. In-Reply-To: References: , Message-ID: Boris, it is actually funny to me that nobody asked this from XSD/e. The whole reason why I need it is because the experimental code that I am writing needs to run on the real-time embedded device, and compressing xml streams is exactly what I need in this application. I want the data exchange packets going to and coming from the device to be as small as possible. It is a bit counter-intuitive to me that people wanted it in XSD, but not in XSD/e. I will give it a thought and let you know. Thanks > Date: Wed, 20 Jun 2012 15:44:52 +0200 > From: boris@codesynthesis.com > To: nikita_visnevski@hotmail.com > CC: xsde-users@codesynthesis.com > Subject: Re: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. > > Hi Nikita, > > Nikita Visnevski writes: > > > Are there plans to support this feature in XSDe? If so, what would be > > the time frame? > > It is on our "possible new features" list, however, it doesn't seem like > something that a lot of people are interested in. In fact, you are the > first person asking for this functionality. So at the moment we have > no plans to implement it any time soon. > > Having said that, if you/your company needs it, we can consider doing > this work as custom development on commercial basis. In fact, if I > remember correctly, the same was implemented in XSD this way. That > is, someone needed it in their application and they paid for its > implementation. Contact me off-list if you are interested. > > > > Any recommendation on what I can do in the meantime? I guess I can try > > to implement a subset of this capability manually, though it sounds like > > a bit of a tedious and daunting task. > > Yes, the easiest way is probably to implement it properly in the compiler > (XSD/e). The other way would be to customize every polymorphic type in your > schema and provide custom insertion/extraction operators that handle > polymorphism. > > Boris From boris at codesynthesis.com Wed Jun 20 12:15:54 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jun 21 04:24:00 2012 Subject: [xsde-users] Polymorphic data model and custom binary streams -- doe not seem to work right. In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > it is actually funny to me that nobody asked this from XSD/e. The whole > reason why I need it is because the experimental code that I am writing > needs to run on the real-time embedded device, and compressing xml streams > is exactly what I need in this application. I want the data exchange > packets going to and coming from the device to be as small as possible. It > is a bit counter-intuitive to me that people wanted it in XSD, but not in > XSD/e. I probably wasn't very clear here. Plenty of people are using the binary representation in situations similar to yours. It is that none of them seem to also use polymorphism. I guess in such "tight" cases most people prefer to keep things as simple as possible. Boris From lucv at etzou.net Thu Jun 21 01:19:56 2012 From: lucv at etzou.net (Luc Verbist) Date: Thu Jun 21 04:25:46 2012 Subject: [xsde-users] unexpected element encountered Message-ID: <74C5618C-2D0B-4014-B6F4-BBD0610F48C4@etzou.net> Hi, I try to use xsde to generate c++ structure for the MPD_2011.xsd file (dash-mpd.xsd) I tried various ways to understand why we error out. Can one give me any hints on the issue. $ ./driver DASH-Ex-G5.xml 3. DASH-Ex-G5.xml:9:56: unexpected element encountered Below is the testcase based on the minimal people example as it will be ported to android and iOS as well Any feedback is welcome. I ran on MacOS Regards, Luc -------------- next part -------------- A non-text attachment was scrubbed... Name: xsde.tar.gz Type: application/x-gzip Size: 560036 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20120621/0cbafda0/xsde.tar-0001.bin From boris at codesynthesis.com Thu Jun 21 05:26:26 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jun 21 05:21:36 2012 Subject: [xsde-users] unexpected element encountered In-Reply-To: <74C5618C-2D0B-4014-B6F4-BBD0610F48C4@etzou.net> References: <74C5618C-2D0B-4014-B6F4-BBD0610F48C4@etzou.net> Message-ID: Hi Luc, Luc Verbist writes: > $ ./driver DASH-Ex-G5.xml > 3. DASH-Ex-G5.xml:9:56: unexpected element encountered In your driver.cxx you have this code: xml_schema::document_pimpl doc_p (MPD_p.root_parser (), MPD_p.root_name ()); This is how you would do it for an XML vocabulary that doesn't use namespaces. However, your schema uses namespaces, so besides the root element name you also need to pass its namespace: xml_schema::document_pimpl doc_p (MPD_p.root_parser (), MPD_p.root_namespace (), MPD_p.root_name ()); With this change your test seems to be working fine. Boris