From pavelpgt at gmail.com Mon May 2 02:59:17 2011 From: pavelpgt at gmail.com (Pavel Pohanka) Date: Mon May 2 02:59:24 2011 Subject: [xsd-users] CityGML deserialization - tag Message-ID: Hallo Adrian Victor Manoliu writes: > To sum up what I've written below (in case you don't have the time to > read everything), the CityGML serialization works, however one tag is > not generated properly - is always replaced by > , perhaps a problem caused by substitution groups. I had same problem some time ago and Boris explained it to me. The problem is really caused by substitution groups, because generated code looks for the first substituting element. You have to write the following code in order to include cityObjectMember: citygml::CityModelType city_model; gml::FeaturePropertyType city_object_member; city_object_member._name ("cityObjectMember"); city_object_member._namespace ("http://www.opengis.net/citygml/1.0"); Then you can write whatever object you like: city_object_member._Feature(some_type); city_model.featureMember().push_back(city_object_member); Ciao, Pavel From boris at codesynthesis.com Tue May 3 05:18:49 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 3 05:00:22 2011 Subject: [xsd-users] See you at BoostCon 2011 Message-ID: Hi, Just a quick note to let you know I am giving two talks at this year's BoostCon[1] conference. The first is titled "Parsing C++ with GCC plugins". It is about the new GCC plugin architecture and how it can be used for parsing C++. The second talk is titled "Object-Relational Mapping with ODB and Boost". It covers the ODB[2] object-relational mapping (ORM) system for C++ and its integration with Boost. If any of you are attending the conference, please say Hi! [1] http://boostcon.boost.org/ [2] http://www.codesynthesis.com/products/odb/ Boris From Cuneyt.Karadag at akbank.com Tue May 3 07:43:30 2011 From: Cuneyt.Karadag at akbank.com (Cuneyt.Karadag@akbank.com) Date: Tue May 3 07:43:56 2011 Subject: [xsd-users] Re: FpML output is not being produced properly In-Reply-To: References: <4639C400EF7C314A92C03309C5B021E8038CBEBB4C@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038CFD96F9@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D095B0A@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D3AAA53@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D580CCA@ABMEXCMBCLS1.akbankdmn.akb> Message-ID: <4639C400EF7C314A92C03309C5B021E80397BE9E53@ABMEXCMBCLS1.akbankdmn.akb> Hi Boris, Actually I have removed all "xercesc::" parts even from the libxsd files. My generated .cc sources could not be compiled if I would not remove them. Now I have restarted my progress from the beginning. I have extracted the tar file I have downloaded from your site. Then I have copied them to the related directory and I have generated all the .cc and .h files again. I have tried to compile my generated files and I got errors below as normal. sumbo@hazdev1% make /opt/SUNWspro/bin/CC -D_RWCONFIG=12d -features=no%localfor -features=no%conststrings -library=no%rwtools7 -erroff=nonewline -I. -I/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include -I/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/suthreads -I/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/sutools -I/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/ie -I/export/home/misys/SUMMIT_V531/summit/CORE_AND_PATCHES_V5_3_1/include -I/export/home/misys/SUMMIT_V531/summit/CORE_AND_PATCHES_V5_3_1/include/suthreads -I/export/home/misys/SUMMIT_V531/summit/CORE_AND_PATCHES_V5_3_1/include/sutools -I/export/home/misys/SUMMIT_V531/summit/CORE_AND_PATCHES_V5_3_1/ie -I/opt/SUNWspro/include/CC -I/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xml -I/export/home/misys/SUMMIT_V531/summit/CORE_AND_PATCHES_V5_3_1/include/xml -I/export/home/misys/SUMMIT_V531/summittools/xercesc-2_8_0-icu3.8.1-Sol10-Studio11/include -I/export/home/misys/SUMMIT_V531/summittools/xercesc-2_8_0-icu3.8.1-Sol10-Studio11/include/xercesc -g -DSU_FEAT005 -DSU_TTRS -DSU_MKV -DSU_SOLARIS_8 -DRELEASE5 -DDEBUG -DRW_NO_OVERLOAD_SCHAR -DSUMMITBASE=\"V51\" -c -KPIC fpml-main-4-7.cc "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/xml/elements.hxx", line 80: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/xml/elements.hxx", line 80: Error: The function "Initialize" must have a prototype. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/xml/elements.hxx", line 86: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/xml/elements.hxx", line 86: Error: The function "Terminate" must have a prototype. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 342: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 352: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 365: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 529: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 541: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 579: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 705: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 718: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 807: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 814: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 823: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 824: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 830: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 890: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 897: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 908: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 916: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 583: Error: xercesc is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 583: Error: ELEMENT_NODE is not defined. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 583: Error: An integer constant expression is required for a case label. "/export/home/misys/SUMMIT_V531/summit/sumbo_V5_3_1/include/xsd/cxx/tree/elements.hxx", line 596: Error: xercesc is not defined. Compilation aborted, too many Error messages. *** Error code 1 make: Fatal error: Command failed for target `fpml-main-4-7.o' sumbo@hazdev1% According to second way of your solution I should fix the XSD runtime library (libxsd) myself not to use Xerces-C++ namespaces. Obviously I could not understand how to do it. Could you please explain it more detail? Thanks for your helps. Cuneyt. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, April 29, 2011 7:07 PM To: C?neyt Karada? (BT Uygulama Geli?tirme B?l?m?) Cc: ?enel Hi?y?lmaz (BT Uygulama Geli?tirme B?l?m?); xsd-users@codesynthesis.com Subject: Re: [xsd-users] Re: FpML output is not being produced properly Hi Cuneyt, Cuneyt.Karadag@akbank.com writes: > xmldsig-core-schema.xsd: warning T004: generating parsing and > serialization functions for 24 global elements > > [...] > > Is this normal? It is a warning that informs that you are getting a lot more code than is probably necessary. You can resolve it by adding --root-element-none when compiling this (and only this) schema. > /opt/SUNWspro/bin/CC -D_RWCONFIG=12d -features=no%localfor ... > > "xmldsig-core-schema.cc", line 13086: Error: Multiple declaration for b. This is caused by the -features=no%localfor option. If you remove it, you won't get any of these errors. > I have fixed these errors by changing the latter variables as n1 b1, > n2 b2, ... and compiled again. That's not the only thing that you have changed in the generated code. You also removed all the xercesc:: namespace qualifications and that's what is causing the errors. You should have mentioned this from the beginning. You seem to have a non-standard build of Xerces-C++ with namespace disabled. We don't support this configuration. As a result, you have two options: 1. Change to the standard Xerces-C++ build with namespaces. You can get a pre-built binary for Solaris from the Xerces-C++ website. 2. Fix the XSD runtime library (libxsd) yourself not to use Xerces-C++ namespaces. To find all the places that need changing, search for XERCES_CPP_NAMESPACE. Boris ________________________________ [http://www.akbank.com/images/disclaimer.jpg] Bu e-posta ve muhtemel eklerinde verilen bilgiler ki?iye ?zel ve gizli olup, yaln?zca mesajda belirlenen al?c? ile ilgilidir. Size yanl??l?kla ula?m??sa l?tfen g?ndericiye bilgi veriniz, mesaj? siliniz ve i?eri?ini ba?ka bir ki?iye a??klamay?n?z, herhangi bir ortama kopyalamay?n?z. Bu mesaj aksi s?zle?me ile belirtilmedik?e herhangi bir finansal i?lem teklifi, al?m?, sat?m? veya herhangi bir havalenin teyidi gibi bankac?l?k i?lemi yap?lmas? amac?n? ta??mamaktad?r. Verilen t?m bilgilerin do?rulu?u ve b?t?nl???n?n garantisi verilmemekte olup, ?nceden bildirilmeksizin de?i?tirilebilecektir. Bu mesaj?n i?eri?i Bankam?z?n resmi g?r??lerini yans?tmayabilece?inden Akbank T.A.?. hi?bir hukuki sorumlulu?u kabul etmez. From boris at codesynthesis.com Tue May 3 09:26:04 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 3 09:07:36 2011 Subject: [xsd-users] Re: FpML output is not being produced properly In-Reply-To: <4639C400EF7C314A92C03309C5B021E80397BE9E53@ABMEXCMBCLS1.akbankdmn.akb> References: <4639C400EF7C314A92C03309C5B021E8038CFD96F9@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D095B0A@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D3AAA53@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E8038D580CCA@ABMEXCMBCLS1.akbankdmn.akb> <4639C400EF7C314A92C03309C5B021E80397BE9E53@ABMEXCMBCLS1.akbankdmn.akb> Message-ID: Hi Cuneyt, Cuneyt.Karadag@akbank.com writes: > Actually I have removed all "xercesc::" parts even from the libxsd files. You also need to change code that references XERCES_CPP_NAMESPACE. > My generated .cc sources could not be compiled if I would not remove them. Yes, because you are using a non-standard Xerces-C++ configuration with namespaces disabled. > According to second way of your solution I should fix the XSD runtime > library (libxsd) myself not to use Xerces-C++ namespaces. Obviously I > could not understand how to do it. > > Could you please explain it more detail? As I mentioned in my previous email we don't support this configuration and if you decide to use it, you will have to figure things out on your own. Boris From sutambe at dre.vanderbilt.edu Tue May 3 12:32:14 2011 From: sutambe at dre.vanderbilt.edu (Sumant Tambe) Date: Tue May 3 12:32:16 2011 Subject: [xsd-users] See you at BoostCon 2011 In-Reply-To: References: Message-ID: <4DC02E0E.7060602@dre.vanderbilt.edu> Hi Boris, I'll be at BoostCon this year to present my work on LEESA. The title of my talk is "Toward Native XML Processing Using Multi-paradigm Design in C++". It is about how we can implement XPath-like programming model on top of data binding using high-tech C++ template machinery. I'm curious to get your feedback on it. Particularly because LEESA also uses CodeSynthesis's xsd. I'll be around for first two days so unfortunately I'll miss your second talk. See ya on May 16th! Thanks, Sumant. On 5/3/2011 2:18 AM, Boris Kolpackov wrote: > Hi, > > Just a quick note to let you know I am giving two talks at this year's > BoostCon[1] conference. The first is titled "Parsing C++ with GCC plugins". > It is about the new GCC plugin architecture and how it can be used for > parsing C++. > > The second talk is titled "Object-Relational Mapping with ODB and Boost". > It covers the ODB[2] object-relational mapping (ORM) system for C++ and > its integration with Boost. > > If any of you are attending the conference, please say Hi! > > [1] http://boostcon.boost.org/ > [2] http://www.codesynthesis.com/products/odb/ > > Boris From diggory.hardy at unibas.ch Thu May 5 08:44:05 2011 From: diggory.hardy at unibas.ch (Diggory Hardy) Date: Thu May 5 09:06:55 2011 Subject: [xsd-users] compile problem when using clang Message-ID: <201105051444.05567.diggory.hardy@unibas.ch> Dear xsd maintainers, I recently had a problem compiling a program using xsd under clang. The offender in this case was pretty clear: /usr/include/xsd/cxx/zc-istream.txx:35:7: error: use of undeclared identifier 'setg' setg (b, b, e); ^ Changing this line to the following solved the problem: std::streambuf::setg (b, b, e); Many thanks, Diggory Hardy Swiss Tropical and Public Health Institute Socinstrasse 57 CH-4051 Basel P.S. please CC correspondance; I am not a member of the mailing list. From boris at codesynthesis.com Mon May 9 09:21:18 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 9 07:05:13 2011 Subject: [xsd-users] compile problem when using clang In-Reply-To: <201105051444.05567.diggory.hardy@unibas.ch> References: <201105051444.05567.diggory.hardy@unibas.ch> Message-ID: Hi Diggory, Diggory Hardy writes: > Dear xsd maintainers, > > I recently had a problem compiling a program using xsd under clang. > The offender in this case was pretty clear: > > /usr/include/xsd/cxx/zc-istream.txx:35:7: error: use of undeclared > identifier 'setg' > setg (b, b, e); > ^ > > Changing this line to the following solved the problem: > > std::streambuf::setg (b, b, e); Thanks for the report. We will definitely fix this for the next release of XSD. When XSD 3.3.0 was released Clang still couldn't compile any serious C++ project. But we will make sure XSD works well with Clang for the next release. Boris From bo-ba at mail.ru Tue May 10 17:30:46 2011 From: bo-ba at mail.ru (Bo Ba) Date: Tue May 10 17:30:55 2011 Subject: [xsd-users] How to build an object process graph with custom types Message-ID: Hello, I would appreciate any thoughts of how suitable is xsd for building an object-process graph in memory for a visual DSL. An example of the application graph, presented in an IDE would look similar to this (http://farm4.static.flickr.com/3398/3330814203_a0e6f80944.jpg):?there are nodes which define data transformations, connected with arcs (one node -- many input/output arcs). I hope to be able to use xsd to parse an xml description of an instance of a program and create an object graph in memory, consisting of my own c++ types. From reading Getting Started guide so far, it seems that I could use XSD to generate a parser from a given schema, which would allow me to build a DOM structure from a given xml patch, which (DOM), in turn could be parsed by my own custom parser to create the executable object graph with custom types. This seems to be doable, however, a specific question I have whether it would be feasible to skip building the DOM structure and directly build my custom object graph using xsd. Thanks. --8 From boris at codesynthesis.com Wed May 11 17:26:47 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 11 15:10:38 2011 Subject: [xsd-users] How to build an object process graph with custom types In-Reply-To: References: Message-ID: Hi, Bo Ba writes: > This seems to be doable, however, a specific question I have whether > it would be feasible to skip building the DOM structure and directly > build my custom object graph using xsd. Yes, the C++/Parser mapping is designed for exactly this: parsing XML and building a custom in-memory representation: http://www.codesynthesis.com/products/xsd/c++/parser/ Boris From fschmidt at techfak.uni-bielefeld.de Wed May 11 15:24:52 2011 From: fschmidt at techfak.uni-bielefeld.de (Florian Paul Schmidt) Date: Wed May 11 15:25:01 2011 Subject: [xsd-users] How to build an object process graph with custom types In-Reply-To: References: Message-ID: <4DCAE284.2010707@techfak.uni-bielefeld.de> On 05/11/2011 11:26 PM, Boris Kolpackov wrote: > Hi, > > Bo Ba writes: > >> This seems to be doable, however, a specific question I have whether >> it would be feasible to skip building the DOM structure and directly >> build my custom object graph using xsd. > Yes, the C++/Parser mapping is designed for exactly this: parsing XML > and building a custom in-memory representation: > > http://www.codesynthesis.com/products/xsd/c++/parser/ > > Boris > Hi folks, maybe i totally missed something, but oftentimes you have another step involved: Building the requested datastructure from the custom in-memory representation of the XML document. For my robotics control "framework" I chose a way of using a global "type registry" which enables me to construct and parametrize the objects needed.. The software is available at github: http://github.com/fps/CBF Especially of interest to you might be the xml_object_factory.h: https://github.com/fps/CBF/blob/master/libcbf/cbf/xml_object_factory.h Note that for this to work, every type you want to construct from a corresponding XML schema type needs a constructor that takes the corresponding schema type as argument: https://github.com/fps/CBF/blob/master/libcbf/cbf/linear_transform.h Also each type has to create a static global instance of the derived factory type in its .cc file, so at library (or application) load time this instance is created and registers itself with the base factory singleton: https://github.com/fps/CBF/blob/master/libcbf/linear_transform.cc This then allows constructed objects to construct its members in turn again using this mechanism. See e.g. lines 259ff here: https://github.com/fps/CBF/blob/master/libcbf/primitive_controller.cc The corresponding schema can be found here: https://github.com/fps/CBF/blob/master/schemas/schemas.xsd Maybe this helps, or maybe it's totally misleading cause i'm a dumba** :D I guess the idea is generic enough to be factored out into a library on its own.. Have fun and play safe, Flo From bo-ba at mail.ru Thu May 12 10:08:26 2011 From: bo-ba at mail.ru (Bo Ba) Date: Thu May 12 10:08:39 2011 Subject: [xsd-users] How to build an object process graph with custom types In-Reply-To: <4DCAE284.2010707@techfak.uni-bielefeld.de> Message-ID: Hi! On 5/11/11 3:24 PM, "Florian Paul Schmidt" wrote: > On 05/11/2011 11:26 PM, Boris Kolpackov wrote: >> Hi, >> >> Bo Ba writes: >> >>> This seems to be doable, however, a specific question I have whether >>> it would be feasible to skip building the DOM structure and directly >>> build my custom object graph using xsd. >> Yes, the C++/Parser mapping is designed for exactly this: parsing XML >> and building a custom in-memory representation: >> >> http://www.codesynthesis.com/products/xsd/c++/parser/ >> >> Boris >> > > Hi folks, > > maybe i totally missed something, but oftentimes you have another step > involved: Building the requested datastructure from the custom in-memory > representation of the XML document. For my robotics control "framework" > I chose a way of using a global "type registry" which enables me to > construct and parametrize the objects needed.. > > The software is available at github: > > http://github.com/fps/CBF > > Especially of interest to you might be the xml_object_factory.h: > > https://github.com/fps/CBF/blob/master/libcbf/cbf/xml_object_factory.h > > Note that for this to work, every type you want to construct from a > corresponding XML schema type needs a constructor that takes the > corresponding schema type as argument: > > https://github.com/fps/CBF/blob/master/libcbf/cbf/linear_transform.h > > Also each type has to create a static global instance of the derived > factory type in its .cc file, so at library (or application) load time > this instance is created and registers itself with the base factory > singleton: > > https://github.com/fps/CBF/blob/master/libcbf/linear_transform.cc > > This then allows constructed objects to construct its members in turn > again using this mechanism. See e.g. lines 259ff here: > > https://github.com/fps/CBF/blob/master/libcbf/primitive_controller.cc > > The corresponding schema can be found here: > > https://github.com/fps/CBF/blob/master/schemas/schemas.xsd > > Maybe this helps, or maybe it's totally misleading cause i'm a dumba** > :D I guess the idea is generic enough to be factored out into a library > on its own.. > > Have fun and play safe, > Flo > > I am not sure I follow you on the difference between "requested datastructure" and "custom in-memory representation of the XML document", however, it seems to me that you have a nice design using factories for each type. Could you explain the difference above? Do you have a runnable example, like xsd's? Thanks. Bo From fschmidt at techfak.uni-bielefeld.de Thu May 12 16:24:47 2011 From: fschmidt at techfak.uni-bielefeld.de (Florian Paul Schmidt) Date: Thu May 12 16:24:44 2011 Subject: [xsd-users] How to build an object process graph with custom types In-Reply-To: References: Message-ID: <4DCC420F.5080500@techfak.uni-bielefeld.de> On 05/12/2011 04:08 PM, Bo Ba wrote: > > I am not sure I follow you on the difference between "requested > datastructure" and "custom in-memory representation of the XML document", > however, it seems to me that you have a nice design using factories for each > type. Could you explain the difference above? Do you have a runnable > example, like xsd's? > > Thanks. > > Bo Hi again. Well, my software uses XSD, too. Let me explain a bit more. Say you have some Type X namespace mystuff { struct Y { // ... }; struct X { Y m_Y; // ... }; } // namespace And corresponding XSD schema types in some .xsd file (an example in my CBF stuff would be e.g. CBF::PrimitiveController and the corresponding XSD schema type (see schemas.xsd)). Now the XSD compiler generates a parser AND a C++ class for each of the types in your schema, in this case X and Y, let's say we have XSD generate them in their own namespace, let's say schema. So XSD generates code for the classes schema::X and schema::Y. And when the generated parser parses a valid XML file corresponding to this schema, it also creates the correct instances of schema::X and schema::Y. But what we really want is to have mystuff::X and mine::Y created. Since this task cannot be completely automated, there is some manual labor involved in this (for example mystuff::X needs to do something with network connections or whatever). So the classes generated by XSD really only represent the XSD schema and the parser generates an object tree of these generated classes when it parses a valid XML file, but does not produce an object tree of your real target objects (in your case the nodes of your dataflow graphical language). The XML factory stuff in CBF is used for exactly this last step. It just makes some repetitive tasks easier. Did i confuse you even more now? :D Regards, Flo From bo-ba at mail.ru Fri May 13 16:58:03 2011 From: bo-ba at mail.ru (Bo Ba) Date: Fri May 13 16:58:13 2011 Subject: =?utf-8?Q?Re[2]=3A_[xsd-users]_How_to_build_an_object_process_graph_with_custom_types?= In-Reply-To: <4DCC420F.5080500@techfak.uni-bielefeld.de> References: <4DCC420F.5080500@techfak.uni-bielefeld.de> Message-ID: Hi Flo It seems that your project is what I was looking for. Correct me if I am wrong, but it seems that xsd cannot handle creation of the custom type instances, only xsd schema types, which, as far as I could gather from the documentation, are extensions of standard c++ classes. Thanks. Bo Thu, 12 May 2011 22:24:47 +0200 ?????? ?? Florian Paul Schmidt : > On 05/12/2011 04:08 PM, Bo Ba wrote: > > > > I am not sure I follow you on the difference between "requested > > datastructure" and "custom in-memory representation of the XML document", > > however, it seems to me that you have a nice design using factories for each > > type. Could you explain the difference above? Do you have a runnable > > example, like xsd's? > > > > Thanks. > > > > Bo > > Hi again. > > Well, my software uses XSD, too. Let me explain a bit more. Say you have > some Type X > > namespace mystuff { > > struct Y { > // ... > }; > > struct X { > Y m_Y; > > // ... > }; > > } // namespace > > And corresponding XSD schema types in some .xsd file (an example in my > CBF stuff would be e.g. CBF::PrimitiveController and the corresponding > XSD schema type (see schemas.xsd)). Now the XSD compiler generates a > parser AND a C++ class for each of the types in your schema, in this > case X and Y, let's say we have XSD generate them in their own > namespace, let's say schema. So XSD generates code for the classes > schema::X and schema::Y. And when the generated parser parses a valid > XML file corresponding to this schema, it also creates the correct > instances of schema::X and schema::Y. But what we really want is to have > mystuff::X and mine::Y created. Since this task cannot be completely > automated, there is some manual labor involved in this (for example > mystuff::X needs to do something with network connections or whatever). > > So the classes generated by XSD really only represent the XSD schema and > the parser generates an object tree of these generated classes when it > parses a valid XML file, but does not produce an object tree of your > real target objects (in your case the nodes of your dataflow graphical > language). > > The XML factory stuff in CBF is used for exactly this last step. It just > makes some repetitive tasks easier. > > Did i confuse you even more now? :D > > Regards, > Flo From sir.costy at gmail.com Fri May 20 11:37:04 2011 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Fri May 20 11:37:13 2011 Subject: [xsd-users] LandXML serialization issue Message-ID: Hello Boris, I try to generate a xml file using a LandXML schema binding. All fine so far but my problem is that some elements are not serialized in the order they are added to a collection. To understand me better I show you the schema and the result that I need And the result should be some like this 4538367.05235564 2588532.52063004 4538588.27618442 2586622.53101275 4538588.27618442 2586622.53101275 4538592.11137973 2586589.41892324 4538593.89095065 2586572.84742423 4538593.89095065 2586572.84742423
4535611.04085678 2586252.52677627
4538611.04084809 2586252.75515951 4538611.02862921 2586413.26006565
4538611.04084809 2586252.75515951 4538611.04211690 2586236.08838266 4538610.76687884 2586202.75606443 4538610.76687884 2586202.75606443 4538595.56061945 2584361.22340159
My problem is that using el binding made by XSD the result xml would look like this 4538367.05235564 2588532.52063004 4538588.27618442 2586622.53101275 4538610.76687884 2586202.75606443 4538595.56061945 2584361.22340159 4538593.89095065 2586572.84742423
4535611.04085678 2586252.52677627
4538611.04084809 2586252.75515951 4538611.02862921 2586413.26006565
4538588.27618442 2586622.53101275 4538592.11137973 2586589.41892324 4538593.89095065 2586572.84742423 4538611.04084809 2586252.75515951 4538611.04211690 2586236.08838266 4538610.76687884 2586202.75606443
The elements are getting ordered by their type and should not. First the all the elements of type "Line" then all "Curve" ... etc Thanks and Regards, Costy From boris at codesynthesis.com Sun May 22 16:25:21 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun May 22 14:08:57 2011 Subject: [xsd-users] LandXML serialization issue In-Reply-To: References: Message-ID: Hi Constantin, Constantin Iacobescu writes: > I try to generate a xml file using a LandXML schema binding. > All fine so far but my problem is that some elements are not serialized in > the order they are added to a collection. This is known a limitation of the C++/Tree mapping. For the detailed discussion and possible work-arounds, see this mailing list post: http://www.codesynthesis.com/pipermail/xsd-users/2010-March/002741.html Boris From ellinger.klaus.ext at siemens.com Mon May 23 10:30:52 2011 From: ellinger.klaus.ext at siemens.com (Ellinger (EXT), Klaus) Date: Mon May 23 10:52:19 2011 Subject: [xsd-users] Custom Types Message-ID: <8616BD3D6AF1C8419FB1F9D1DB58416C015B5716@DEKOMMBX001A.net.plm.eds.com> Hi Experts, I am trying to create custom XSD types but I am not able to do so ... Hopefully some of you can give me an hint what I am doing wrong: Following my Schema: ######################################################################################################################## ######################################################################################################################## Command to generate: xsd.exe cxx-tree\ --root-element catalog\ --generate-ostream\ --generate-serialization\ --output-dir\ --generate-polymorphic\ --custom-type "condition=condition_impl/condition_base"\ --custom-type "extract=extract_impl/extract_base"\ --generate-forward\ --fwd-prologue "#include \"Condition-custom_fwd.hxx\""\ --hxx-prologue "#include \"Condition-custom.hxx\""\ --output-dir $(XSD_OUTPUT_DIR)\ $(XSD_INPUT_DIR)\Condition.xsd Condition-custom_fwd.hxx namespace Condition { template class condition_impl; template class extract_impl; } Condition-custom.hxx ######################################################################################################################## #include "Condition-fwd.hxx" namespace Condition { template class condition_impl: public base { public: condition_impl(const ::xml_schema::string& name); condition_impl(const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); condition_impl(const condition_impl& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); virtual condition_impl* _clone(::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const; public: virtual void sayHello(); }; template class extract_impl: public base { public: extract_impl(const ::xml_schema::string& name, const ::xml_schema::string& target); extract_impl(const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); extract_impl(const extract_impl& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); virtual extract_impl* _clone(::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const; public: virtual void sayHello(); }; } ######################################################################################################################## And my Implementation Condition-custom.cxx: ######################################################################################################################## #include "Condition.hxx" namespace Condition { template condition_impl::condition_impl(const ::xml_schema::string& name) : base(name) { printf("Condition created\n"); } template condition_impl::condition_impl(const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0) : base(e, f, c) { printf("Condition created\n"); } template condition_impl::condition_impl(const condition_impl& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0) : base(x, f, c) { printf("Condition created\n"); } template condition_impl* condition_impl::_clone(::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const { return new condition_impl(*this, f, c); } template void condition_impl::sayHello() { printf("I am a Condition\n"); } template class condition_impl; template extract_impl::extract_impl(const ::xml_schema::string& name, const ::xml_schema::string& target) : base(name, target) { printf("Extractor created\n"); } template extract_impl::extract_impl(const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0) : base(e, f, c) { printf("Extractor created\n"); } template extract_impl::extract_impl(const extract_impl& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0) : base(x, f, c) { printf("Extractor created\n"); } template extract_impl* extract_impl::_clone(::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const { return new extract_impl(*this, f, c); } template void extract_impl::sayHello() { printf("I am a special Condition\n"); } template class extract_impl; } ######################################################################################################################## Everything compiles fine without any Erros but if I invoke my sample application: ######################################################################################################################## #include #include #include // std::auto_ptr #include #include "Condition.hxx" int main(int argc, char *argv[]) { try { using namespace Condition; std::auto_ptr < catalog > c(catalog_(".\\Condition.xml")); for (catalog::condition_iterator i(c->condition().begin()); i != c->condition().end(); ++i) { i->sayHello(); } } catch (const xml_schema::exception& e) { std::cerr << e << std::endl; return 1; } } ######################################################################################################################## With following XML: ######################################################################################################################## name name1 name2 ######################################################################################################################## I got the following result: Condition created Condition created Condition created I am a Condition I am a Condition I am a Condition I expected following: Condition created Extractor created Extractor created Hello I am a Condition I am a special Condition I am a special Condition Any Help appreciated!!! Thx allot Klaus From boris at codesynthesis.com Mon May 23 13:23:16 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 23 11:06:54 2011 Subject: [xsd-users] Custom Types In-Reply-To: <8616BD3D6AF1C8419FB1F9D1DB58416C015B5716@DEKOMMBX001A.net.plm.eds.com> References: <8616BD3D6AF1C8419FB1F9D1DB58416C015B5716@DEKOMMBX001A.net.plm.eds.com> Message-ID: Hi Klaus, Ellinger (EXT), Klaus writes: > Command to generate: > > xsd.exe cxx-tree\ > --root-element catalog\ > --generate-ostream\ > --generate-serialization\ > --output-dir\ > --generate-polymorphic\ > --custom-type "condition=condition_impl/condition_base"\ > --custom-type "extract=extract_impl/extract_base"\ > --generate-forward\ > --fwd-prologue "#include \"Condition-custom_fwd.hxx\""\ > --hxx-prologue "#include \"Condition-custom.hxx\""\ > --output-dir $(XSD_OUTPUT_DIR)\ > $(XSD_INPUT_DIR)\Condition.xsd If you are using XSD 3.3.0 (or later), you will also need to add the --polymorphic-type option: --polymorphic-type condition See Section 2.11, "Mapping for xsi:type and Substitution Groups" in the C++/Tree Mapping User Manual for more information on this option: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.11 I am pretty sure this is the reason your example doesn't work as expected. Can you give this fix a try and see if it helps? Boris From marcelo.lopes at sinapsisenergia.com Thu May 19 20:24:40 2011 From: marcelo.lopes at sinapsisenergia.com (Marcelo Lopes) Date: Mon May 23 14:37:51 2011 Subject: [xsd-users] Borland C++ Message-ID: <00bb01cc1684$50cda3d0$f268eb70$@sinapsisenergia.com> Dear all, I would like to know if the XML Data Binding for C++ is compatible with the Borland Builder C++ 2007. Thank you for your attention, Marcelo. From boris at codesynthesis.com Mon May 23 16:58:57 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 23 14:42:45 2011 Subject: [xsd-users] Borland C++ In-Reply-To: <00bb01cc1684$50cda3d0$f268eb70$@sinapsisenergia.com> References: <00bb01cc1684$50cda3d0$f268eb70$@sinapsisenergia.com> Message-ID: Hi Marcelo, Marcelo Lopes writes: > I would like to know if the XML Data Binding for C++ is compatible with the > Borland Builder C++ 2007. I haven't tried it myself, but I am pretty sure the answer is No since this compiler is not capable of correctly handling too many standard C++ constructs. If you are stuck with BCB, then you may want to consider using XSD/e instead since it was designed to be usable with legacy/broken C++ compilers. In particular, the C++/Hybrid mapping in XSD/e is quite similar to C++/Tree in XSD: http://www.codesynthesis.com/products/xsde/ Boris From jordanburnam1990 at me.com Tue May 24 15:30:44 2011 From: jordanburnam1990 at me.com (Jordan Burnam) Date: Tue May 24 15:31:26 2011 Subject: [xsd-users] expat.h: File does not exist or No such Directory Message-ID: I am trying to implement the example "hello.xsd" I have installed the msi for my OS. I have also included the directories as stated in the readme file. I am running Windows 7 and am using Microsoft Visaul C++ 2008. I have the following directories installed: Excurtables: C:\Program Files\CodeSynthesis XSD 3.3\bin Include: C:\Program Files\CodeSynthesis XSD 3.3\include Library: C:\Program Files\CodeSynthesis XSD 3.3\lib\vc-9.0 All these files have beem verrified by Visaul C++ as they exist and are valid. I am getting the error that the expat.h file does not exist and can not be included? Any help would be appreciated. From boris at codesynthesis.com Wed May 25 02:50:37 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 25 00:34:33 2011 Subject: [xsd-users] expat.h: File does not exist or No such Directory In-Reply-To: References: Message-ID: Hi Jordan, Jordan Burnam writes: > I am getting the error that the expat.h file does not exist and can not > be included? You seem to be using the C++/Parser mapping with Expat as the underlying XML parser. For this configuration you will need to download and install Expat. For Windows there are pre-compiled libraries available (look into the expat_win32 sub-directory): http://sourceforge.net/projects/expat/files/ Boris From barrie.kovish at singularsoftware.com Sun May 29 11:44:59 2011 From: barrie.kovish at singularsoftware.com (Barrie Kovish) Date: Sun May 29 11:45:09 2011 Subject: [xsd-users] Possible bug 2 Message-ID: <76D7B929-741D-42E3-8FAF-97BC117E2104@singularsoftware.com> I believe I have found a bug similar to a previous bug (see mailing list Aug 31, 2010 subject "Possible bug"). Here is a snippet of my code which generates the problem: // pHouse1 and pHouse2 point to Code Synthesis generated objects. assert( NULL != pHouse1 ); assert( NULL != pHouse1->_root()); assert( NULL != pHouse2 ); assert( NULL != pHouse2->_root()); house::room_sequence * pRooms = pHouse1->room(); assert( NULL != pRooms ); assert( 2 == pRooms->size()); house::room_sequence * pRoomsCheck = pHouse2->room(); assert( NULL != pRoomsCheck ); assert( 0 == pRoomsCheck->size()); // The pRooms sequence will replace the pRoomsCheck sequence. // Since they have different sizes they are not the same and since pRoomsCheck is empty // they do not share content. pHouse2->room( pRooms ); The failure occurs in the same spot as before: File: elements.hxx (patched from 2010-09-01) Struct: dom_element_info: public dom_info Method: virtual std::auto_ptr clone (type& tree_node, container* c) const Line: 807 Code: assert (dn->getNodeType () == DOMNode::ELEMENT_NODE); In this case as the previous one dn is NULL. As in the pervious case it appears that // Move in parallel until we get to the needed node. // for (; sn != 0 && !e_.isSameNode (sn);) { sn = sn->getNextSibling (); dn = dn->getNextSibling (); } e_ is equal to sn and the loop contents are not executed and hence dn is never set. This bug causes our code to crash on some common conditions so we really need a fix. Thanks, Barrie From barrie.kovish at singularsoftware.com Sun May 29 12:07:38 2011 From: barrie.kovish at singularsoftware.com (Barrie Kovish) Date: Sun May 29 12:07:46 2011 Subject: [xsd-users] re: Possible bug 2 Message-ID: <95F7E2E9-2C98-4849-9EE3-3D2BC97FE8BB@singularsoftware.com> Here is a stack trace (slightly edited) for bug 2 xsd::cxx::tree::_type::dom_element_info::clone at elements.hxx:808 xsd::cxx::tree::_type::_type at elements.hxx:971 room::room at XMLCode.cxx:12664 room::_clone at XMLCode.cxx:12753 xsd::cxx::tree::sequence_common::operator= at containers.hxx:909 xsd::cxx::tree::sequence::operator= at containers.hxx:524 Barrie From a.d.romanov at yandex.ru Mon May 30 09:25:32 2011 From: a.d.romanov at yandex.ru (=?koi8-r?B?8s/Nwc7P1yDhzMXL08HOxNI=?=) Date: Mon May 30 13:03:40 2011 Subject: [xsd-users] Strange parsing ans serialization code with --char-type wchar_t Message-ID: <935071306761933@web115.yandex.ru> Hi. I want to use wchar_t type instead of char. So, I expect object model is able to be serialized into\parsed from std::wostream. But the generated code for parsing from\serialization into stream uses std::ostream. Btw, code for parsing URI or local file, by contrast, uses std::wstring to indicate a file name\URI in case of wchar_t, and std::string in case of char. So, the question is how can I make xsd to generate serialization\parsing code that works with std::wostream? From boris at codesynthesis.com Mon May 30 15:25:42 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 30 13:09:17 2011 Subject: [xsd-users] Strange parsing ans serialization code with --char-type wchar_t In-Reply-To: <935071306761933@web115.yandex.ru> References: <935071306761933@web115.yandex.ru> Message-ID: Hi, a.d.romanov@yandex.ru writes: > Hi. I want to use wchar_t type instead of char. So, I expect object model > is able to be serialized into\parsed from std::wostream. But the generated > code for parsing from\serialization into stream uses std::ostream. This post in the archives discusses this issue and possible solutions in detail: http://www.codesynthesis.com/pipermail/xsd-users/2010-November/003048.html Boris