From victor.fine at gmail.com Thu Aug 1 11:20:37 2013 From: victor.fine at gmail.com (Victor Fine) Date: Thu Aug 1 11:20:44 2013 Subject: [xsd-users] Member of derived class is sliced on ouptut Message-ID: Hello, I've generated cxx-tree classes from XSDs. I've used the following flags: --root-element-all --generate-polymorphic --generate-serialization One of the members of the object I'm serializing is holding a derived type (at least it is derived in the XSD schema) Though I can see the derived class members in the debugger, they are not included in output. Am I missing something basic ? Thank you. From giuseppe500 at yahoo.it Thu Aug 1 21:54:39 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Fri Aug 2 08:06:23 2013 Subject: [xsd-users] ifc xml and configuration schema xsd Message-ID: <1375408479.45554.YahooMailNeo@web171405.mail.ir2.yahoo.com> hello Boris. I'm find your old help on my ifc files with the nillable type, and I'm still reading the Definitive XML Schema but i don't understand some things I have a problem in loading ifcxml files from allplan with the xsd.exe tree generator. I attach all my files, with the xml . I ask you: 1) i hope that the allplan ifc xml files are Validable, then where i can "put the hand" or change something for get the result? 1)Xerces? 2)xsd? 3)create an xslt trasformation that "repairs" the problem? 2)I see that there are 3 xsd one , the configuration.xsd i don't understand what does, i must import it in my xsd.exe command line? and in the ex.xsd there is this code: i must uncomment the configuration line? what do this configuration file ? thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: ifc.zip Type: application/zip Size: 23280 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20130802/b5eddf96/ifc.zip From boris at codesynthesis.com Fri Aug 2 08:10:57 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Aug 2 08:11:27 2013 Subject: [xsd-users] Member of derived class is sliced on ouptut In-Reply-To: References: Message-ID: Hi Victor, Victor Fine writes: > I've generated cxx-tree classes from XSDs. I've used the following flags: > --root-element-all --generate-polymorphic --generate-serialization > > One of the members of the object I'm serializing is holding a derived type > (at least it is derived in the XSD schema) > > Though I can see the derived class members in the debugger, they are not > included in output. It is hard to say for certain what's wrong without more details. I don't even know what kind of output you are talking about, XML, ostream, binary? But, most likely, you didn't tell XSD that the root of your hierarchy is polymorphic with the --polymorphic-type option. You could also use --polymorphic-type-all though that is not recommended since it can result in significant code bloat. Boris From boris at codesynthesis.com Fri Aug 2 08:15:23 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Aug 2 08:15:54 2013 Subject: [xsd-users] ifc xml and configuration schema xsd In-Reply-To: <1375408479.45554.YahooMailNeo@web171405.mail.ir2.yahoo.com> References: <1375408479.45554.YahooMailNeo@web171405.mail.ir2.yahoo.com> Message-ID: Hi Giuseppe giuseppe ferrari writes: > I have a problem in loading ifcxml files from allplan with the xsd.exe > tree generator. I attach all my files, with the xml. I don't see any XML documents attached. Boris From victor.fine at gmail.com Sun Aug 4 04:35:18 2013 From: victor.fine at gmail.com (Victor Fine) Date: Sun Aug 4 04:35:25 2013 Subject: [xsd-users] Member of derived class is sliced on ouptut In-Reply-To: References: Message-ID: Thank you Boris, --polymorphic-type solved the problem indeed. 2013/8/2 Boris Kolpackov > Hi Victor, > > Victor Fine writes: > > > I've generated cxx-tree classes from XSDs. I've used the following flags: > > --root-element-all --generate-polymorphic --generate-serialization > > > > One of the members of the object I'm serializing is holding a derived > type > > (at least it is derived in the XSD schema) > > > > Though I can see the derived class members in the debugger, they are not > > included in output. > > It is hard to say for certain what's wrong without more details. > I don't even know what kind of output you are talking about, XML, > ostream, binary? > > But, most likely, you didn't tell XSD that the root of your > hierarchy is polymorphic with the --polymorphic-type option. > You could also use --polymorphic-type-all though that is not > recommended since it can result in significant code bloat. > > Boris > From soroush.rabiei at gmail.com Tue Aug 6 07:04:52 2013 From: soroush.rabiei at gmail.com (Soroush Rabiei) Date: Tue Aug 6 07:05:20 2013 Subject: [xsd-users] C++ Move Semantics Message-ID: Hi list I've encountered a problem with XSD parser. I have a couple of move-only C++ classes that should be generated from xml file. I'm using type map file as described in the documentation. The problem is that generated code have a lot of errors. Since there is no copy constructor in my classes, compiler refuses to pass tmp as an l-value. This is map file: (xcsp.map) // ... variable_t AIT::CSP::Variable AIT::CSP::Variable; // ... Generated code: AIT::CSP::Variable tmp (this->variable_parser_->post_variable_t ()); this->variable (tmp); // <== error: cannot bind 'AIT::CSP::Variable' lvalue to 'AIT::CSP::Variable&&' That should be either : this->variable (this->variable_parser_->post_variable_t ()); Or this: AIT::CSP::Variable tmp (this->variable_parser_->post_variable_t ()); this->variable (std::move(tmp)); Currently I'm modifying generated files manually. That's difficult to maintain and badly breaks our teamwork. We've discussed about changing our XSD parser staff with a new one. Though it needs huge amount of effort and time to change a large codebase. I think a patch in XSD is better in terms of maintenance and effort. I just cloned xsd repo. How can I change the code to modify produced codes as mentioned above? The other question is that should I release the patch or provide a link in project homepage? I'm not familiar with legal aspects of the library. Our project is GNU LGPL 2.1. Cheers Soroush From boris at codesynthesis.com Tue Aug 6 10:52:42 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Aug 6 10:53:11 2013 Subject: [xsd-users] C++ Move Semantics In-Reply-To: References: Message-ID: Hi Soroush, Soroush Rabiei writes: > this->variable (tmp); // <== error: cannot bind 'AIT::CSP::Variable' This has already been discussed on the mailing list recently and we have made a fix for the upcoming release: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=9e53510ee0bb5f74536f0e1636f0fb2d55edffc1 I can build you a pre-release binary if you would like to give it a try and don't want to build XSD yourself. Boris From soroush.rabiei at gmail.com Tue Aug 6 12:07:35 2013 From: soroush.rabiei at gmail.com (Soroush Rabiei) Date: Tue Aug 6 12:08:04 2013 Subject: [xsd-users] C++ Move Semantics In-Reply-To: References: Message-ID: > > This has already been discussed on the mailing list recently and we > have made a fix for the upcoming release: > > > http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=9e53510ee0bb5f74536f0e1636f0fb2d55edffc1 > > I can build you a pre-release binary if you would like to give it > a try and don't want to build XSD yourself. > > Boris > Hi Boris I just finished compiling my patched version. I found that you already added a switch (--std flag) to control generated code. But I can't get it to work. So I removed code that writes tmp on output. It works fine for now. We will wait for next release. Thanks From rajeshwari.sajjan at gmail.com Wed Aug 14 08:16:36 2013 From: rajeshwari.sajjan at gmail.com (rajeshwari sajjan) Date: Wed Aug 14 08:17:04 2013 Subject: [xsd-users] default_value_xsd_ and_parsing Message-ID: Hi I have the following thing I'd like to achieve: When I get an xml that have the empty NO_OF_TEST_CASES element , parsing of the xml fails. It will generate an error "invalid integer value". It would be great if you can help regarding this. Regards, Rajeshwari From boris at codesynthesis.com Wed Aug 14 09:39:24 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 14 09:39:52 2013 Subject: [xsd-users] default_value_xsd_ and_parsing In-Reply-To: References: Message-ID: Hi Rajeshwari, rajeshwari sajjan writes: > When I get an xml that have the empty NO_OF_TEST_CASES element, parsing > of the xml fails. > > It will generate an error "invalid integer value". What is the corresponding XML fragment that you are parsing and do you have validation enable? You may also find the following earlier post relevant: http://www.codesynthesis.com/pipermail/xsd-users/2010-February/002719.html Boris From rajeshwari.sajjan at gmail.com Mon Aug 19 01:31:33 2013 From: rajeshwari.sajjan at gmail.com (rajeshwari sajjan) Date: Mon Aug 19 01:32:00 2013 Subject: [xsd-users] default_value_xsd_ and_parsing In-Reply-To: References: Message-ID: Hi, I want to parse the GWT fragment and validation is enabled. How to disable the validation? On Wed, Aug 14, 2013 at 7:09 PM, Boris Kolpackov wrote: > Hi Rajeshwari, > > rajeshwari sajjan writes: > > > When I get an xml that have the empty NO_OF_TEST_CASES element, parsing > > of the xml fails. > > > > It will generate an error "invalid integer value". > > What is the corresponding XML fragment that you are parsing and > do you have validation enable? > > You may also find the following earlier post relevant: > > http://www.codesynthesis.com/pipermail/xsd-users/2010-February/002719.html > > Boris > -- Regards, Rajeshwari From neeraj.vaidya at yahoo.co.in Wed Aug 21 09:18:09 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Wed Aug 21 09:18:19 2013 Subject: [xsd-users] error trying to build examples Message-ID: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> Hi, ? I am using xsd on the Solaris 10 for SPARC platform. I have xercesc 3.1.1 installed, but when trying to build the hello example, I get the following error while linking the driver module. Please help. The compilation goes through fine, though. Just the linker which starts complaining. The libxerces-c.so file is also present at the location passed to the g++ compiler, but not sure why the following symbols are showing up as "undefined". ? Undefined?????????????????????? first referenced ?symbol???????????????????????????? in file xercesc_3_1::XMLAttDefList::serialize(xercesc_3_1::XSerializeEngine&)hello.o xercesc_3_1::XMLAttDefList::getProtoType() const hello.o typeinfo for xercesc_3_1::DOMLSExceptionhello.o xercesc_3_1::InputSource::setSystemId(unsigned short const*)hello.o xercesc_3_1::XMLUni::fgDOMElementContentWhitespace????? hello.o typeinfo for xercesc_3_1::BinInputStreamhello.o xercesc_3_1::XMemory::operator delete(void*)hello.o xercesc_3_1::XMLUni::fgDOMEntities????? hello.o xercesc_3_1::InputSource::~InputSource [not-in-charge]()hello.o xercesc_3_1::BinInputStream::BinInputStream[not-in-charge]()hello.o xercesc_3_1::BinInputStream::~BinInputStream [not-in-charge]()hello.o xercesc_3_1::XMLUni::fgXercesUserAdoptsDOMDocument????? hello.o xercesc_3_1::InputSource::InputSource[not-in-charge](xercesc_3_1::MemoryManager*)hello.o xercesc_3_1::XMLUni::fgXercesHandleMultipleImports????? hello.o typeinfo for xercesc_3_1::InputSourcehello.o xercesc_3_1::InputSource::setPublicId(unsigned short const*)hello.o xercesc_3_1::XMLUni::fgXercesLoadSchema????? hello.o xercesc_3_1::XMLPlatformUtils::Initialize(char const*, char const*, xercesc_3_1::PanicHandler*, xercesc_3_1::MemoryManager*)hello.o xercesc_3_1::XMLUni::fgXercesSchemaFullChecking????? hello.o xercesc_3_1::InputSource::InputSource[not-in-charge](unsigned short const*, xercesc_3_1::MemoryManager*)hello.o xercesc_3_1::Wrapper4InputSource::Wrapper4InputSource[in-charge](xercesc_3_1::InputSource*, bool, xercesc_3_1::MemoryManager*)hello.o xercesc_3_1::XMemory::operator new(unsigned)hello.o xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation????? hello.o xercesc_3_1::XMLUni::fgDOMComments????? hello.o xercesc_3_1::XMLUni::fgXercescDefaultLocale????? hello.o xercesc_3_1::XMLUni::fgDOMValidate????? hello.o xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation????? hello.o xercesc_3_1::Wrapper4InputSource::~Wrapper4InputSource [in-charge]()hello.o xercesc_3_1::XMLUni::fgDOMNamespaces????? hello.o xercesc_3_1::DOMImplementationRegistry::getDOMImplementation(unsigned short const*)hello.o xercesc_3_1::XMLUni::fgDOMErrorHandler????? hello.o xercesc_3_1::InputSource::setEncoding(unsigned short const*)hello.o xercesc_3_1::XMLPlatformUtils::fgMemoryManager?????? hello.o xercesc_3_1::XMLPlatformUtils::Terminate()???? hello.o xercesc_3_1::XMLAttDefList::isSerializable() const hello.o xercesc_3_1::XMLUni::fgXercesSchema????? hello.o xercesc_3_1::XMLUni::fgDOMDatatypeNormalization????? hello.o ld: fatal: Symbol referencing errors. No output written to driver collect2: ld returned 1 exit status From boris at codesynthesis.com Wed Aug 21 11:21:55 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 21 11:23:11 2013 Subject: [xsd-users] error trying to build examples In-Reply-To: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: Hi Neeraj, Neeraj Vaidya writes: > I am using xsd on the Solaris 10 for SPARC platform. > > [...] > > The compilation goes through fine, though. Just the linker which > starts complaining. I am 99.9% sure you are using Xerces-C++ built with Sun CC while your application is built with g++. If that's the case, you need to re-build Xerces-C++ with g++. Boris From boris at codesynthesis.com Wed Aug 21 11:24:28 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 21 11:25:44 2013 Subject: [xsd-users] default_value_xsd_ and_parsing In-Reply-To: References: Message-ID: Hi Rajeshwari, rajeshwari sajjan writes: > > > > > > > > > > > I want to parse the GWT fragment and validation is enabled. Please re-read my reply to your previous email. I've asked you to show the XML fragment you are trying to parse, not the schema definition. Boris From neeraj.vaidya at yahoo.co.in Wed Aug 21 12:15:02 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Wed Aug 21 12:15:11 2013 Subject: [xsd-users] error trying to build examples In-Reply-To: References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> Hi?Boris, ? Thanks for your reply. I am actually using the default xerces package supplied by apache for Solaris 10 Sparc. I will try building the Xerces library using g++ and then try the xsd samples again. But for my information, what is the difference between using different compilers ? I thought if the OS is the same, the built binaries should work on both platforms. ? Regards, Neeraj ________________________________ From: Boris Kolpackov To: Neeraj Vaidya Cc: "xsd-users@codesynthesis.com" Sent: Wednesday, 21 August 2013 8:51 PM Subject: Re: [xsd-users] error trying to build examples Hi Neeraj, Neeraj Vaidya writes: > I am using xsd on the Solaris 10 for SPARC platform. > > [...] > > The compilation goes through fine, though. Just the linker which > starts complaining. I am 99.9% sure you are using Xerces-C++ built with Sun CC while your application is built with g++. If that's the case, you need to re-build Xerces-C++ with g++. Boris From neeraj.vaidya at yahoo.co.in Wed Aug 21 13:00:13 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Wed Aug 21 13:00:24 2013 Subject: [xsd-users] error trying to build examples In-Reply-To: <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: <1377104413.13448.YahooMailNeo@web194003.mail.sg3.yahoo.com> Hi Boris, ? I built the xerces-3.1.1 source package using the g++ compiler, but still get the same error. What could be wrong ? ? Regards, Neeraj ________________________________ From: Neeraj Vaidya To: "xsd-users@codesynthesis.com" Sent: Wednesday, 21 August 2013 9:45 PM Subject: Re: [xsd-users] error trying to build examples Hi?Boris, ? Thanks for your reply. I am actually using the default xerces package supplied by apache for Solaris 10 Sparc. I will try building the Xerces library using g++ and then try the xsd samples again. But for my information, what is the difference between using different compilers ? I thought if the OS is the same, the built binaries should work on both platforms. ? Regards, Neeraj ________________________________ From: Boris Kolpackov To: Neeraj Vaidya Cc: "xsd-users@codesynthesis.com" Sent: Wednesday, 21 August 2013 8:51 PM Subject: Re: [xsd-users] error trying to build examples Hi Neeraj, Neeraj Vaidya writes: > I am using xsd on the Solaris 10 for SPARC platform. > > [...] > > The compilation goes through fine, though. Just the linker which > starts complaining. I am 99.9% sure you are using Xerces-C++ built with Sun CC while your application is built with g++. If that's the case, you need to re-build Xerces-C++ with g++. Boris From lenaherscheid at gmail.com Wed Aug 21 11:50:39 2013 From: lenaherscheid at gmail.com (Lena Herscheid) Date: Wed Aug 21 14:03:27 2013 Subject: [xsd-users] how to get type information from tree nodes Message-ID: <007401ce9e86$30140df0$903c29d0$@gmail.com> Hi, Is it possible with cxx-tree to generate member functions returning the typename of the current node (as string)? I'm asking because the alternative way of efficiently determining the type of any during runtime requires some RTTI which is not portable. Thanks in advance Lena From boris at codesynthesis.com Wed Aug 21 14:16:22 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 21 14:17:37 2013 Subject: [xsd-users] how to get type information from tree nodes In-Reply-To: <007401ce9e86$30140df0$903c29d0$@gmail.com> References: <007401ce9e86$30140df0$903c29d0$@gmail.com> Message-ID: Hi Lena, Lena Herscheid writes: > Is it possible with cxx-tree to generate member functions returning the > typename of the current node (as string)? No, there is no such support. > I'm asking because the alternative way of efficiently determining the type > of any during runtime requires some RTTI which is not portable. I am not sure what you mean by "some RTTI", but standard C++ RTTI (i.e., dynamic_cast, typeid) are very much portable. Some projects may choose to disable this support in order to minimize code size, but that's another story. So if you need a type name in C++/Tree, then typeid(x).name () is the recommended way. If, however, you want to find whether x is of a particular dynamic type, then use dynamic_cast, it will be much faster than any custom RTTI with string comparison: base& x = ... if (derived1* d1 = dynamic_cast (&x)) { // x is derived1 } else if (derived2* d2 = dynamic_cast (&x)) { // x is derived2 } ... else { // x is something else } Boris From boris at codesynthesis.com Wed Aug 21 14:19:40 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 21 14:20:55 2013 Subject: [xsd-users] error trying to build examples In-Reply-To: <1377104413.13448.YahooMailNeo@web194003.mail.sg3.yahoo.com> References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377104413.13448.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: Hi Neeraj, Neeraj Vaidya writes: > I built the xerces-3.1.1 source package using the g++ compiler, but > still get the same error. What could be wrong ? You either didn't build it with g++ (did you specify CXX=g++ in configure command line?) or you are still linking to the old library (try removing all copies of libxerces-c.so from your computer except for the one you just built). > But for my information, what is the difference between using > different compilers? I thought if the OS is the same, the built > binaries should work on both platforms. No, the C++ ABIs (i.e., how the symbols are named) as used by g++ and Sun CC are different. Boris From neeraj.vaidya at yahoo.co.in Wed Aug 21 21:25:10 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Wed Aug 21 21:23:21 2013 Subject: [xsd-users] error trying to build examples In-Reply-To: References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377104413.13448.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: Hi Boris I did specify CXX=g++ on the configure command line. Let me try to see if there are any other libxerces-c.so files lingering around. Also, can I use libexpat instead of xerces ? Regards Neeraj On 21/08/2013, at 11:49 PM, Boris wrote: > Hi Neeraj, > > Neeraj Vaidya writes: > >> I built the xerces-3.1.1 source package using the g++ compiler, but >> still get the same error. What could be wrong ? > > You either didn't build it with g++ (did you specify CXX=g++ in > configure command line?) or you are still linking to the old library > (try removing all copies of libxerces-c.so from your computer except > for the one you just built). > > >> But for my information, what is the difference between using >> different compilers? I thought if the OS is the same, the built >> binaries should work on both platforms. > > No, the C++ ABIs (i.e., how the symbols are named) as used by g++ > and Sun CC are different. > > Boris From lenaherscheid at gmail.com Wed Aug 21 18:05:33 2013 From: lenaherscheid at gmail.com (Lena Herscheid) Date: Thu Aug 22 06:23:16 2013 Subject: AW: [xsd-users] how to get type information from tree nodes In-Reply-To: References: <007401ce9e86$30140df0$903c29d0$@gmail.com> Message-ID: <000b01ce9eba$a64d1be0$f2e753a0$@gmail.com> Thanks for the quick answer! When saying that RTTI was not portable, I was referring to platform differences with typeidx().name(). But it surely is possible to compare to the typeid of a "fresh class instance" instead of hard coded strings. So I'll certainly find a solution. Cheers Lena -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: 21 August 2013 20:16 An: Lena Herscheid Cc: xsd-users@codesynthesis.com Betreff: Re: [xsd-users] how to get type information from tree nodes Hi Lena, Lena Herscheid writes: > Is it possible with cxx-tree to generate member functions returning > the typename of the current node (as string)? No, there is no such support. > I'm asking because the alternative way of efficiently determining the > type of any during runtime requires some RTTI which is not portable. I am not sure what you mean by "some RTTI", but standard C++ RTTI (i.e., dynamic_cast, typeid) are very much portable. Some projects may choose to disable this support in order to minimize code size, but that's another story. So if you need a type name in C++/Tree, then typeid(x).name () is the recommended way. If, however, you want to find whether x is of a particular dynamic type, then use dynamic_cast, it will be much faster than any custom RTTI with string comparison: base& x = ... if (derived1* d1 = dynamic_cast (&x)) { // x is derived1 } else if (derived2* d2 = dynamic_cast (&x)) { // x is derived2 } ... else { // x is something else } Boris From G.Klima at durst-online.at Thu Aug 22 12:28:51 2013 From: G.Klima at durst-online.at (Klima Georg) Date: Thu Aug 22 12:29:04 2013 Subject: AW: [xsd-users] how to get type information from tree nodes In-Reply-To: <000b01ce9eba$a64d1be0$f2e753a0$@gmail.com> References: <007401ce9e86$30140df0$903c29d0$@gmail.com> <000b01ce9eba$a64d1be0$f2e753a0$@gmail.com> Message-ID: <2E884AD3C8BC814186EA906C9C487F2263038E8C@ditmail1> Hi Lena! Eventually this could also be a solution for you! http://www.artima.com/cppsource/cooperative_visitor.html Read the Section about "Generating tags". This or a modified version that introduces static (runtime) tagging with unique integer IDs could be of interest for you. Also this could be of interest for xsd in general. Since this method introduces lesser overhead that rtti and isn't that cumbersome as trying one dynamic_cast after another! Mit freundlichen Gr??en / Best regards Georg Klima Ps: eventually there are other/better sources concering tagging but this was the first in reach I could remember! -----Urspr?ngliche Nachricht----- Von: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] Im Auftrag von Lena Herscheid Gesendet: Donnerstag, 22. August 2013 00:06 An: xsd-users@codesynthesis.com Betreff: *****POSSIBLE SPAM***** AW: [xsd-users] how to get type information from tree nodes Thanks for the quick answer! When saying that RTTI was not portable, I was referring to platform differences with typeidx().name(). But it surely is possible to compare to the typeid of a "fresh class instance" instead of hard coded strings. So I'll certainly find a solution. Cheers Lena -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: 21 August 2013 20:16 An: Lena Herscheid Cc: xsd-users@codesynthesis.com Betreff: Re: [xsd-users] how to get type information from tree nodes Hi Lena, Lena Herscheid writes: > Is it possible with cxx-tree to generate member functions returning > the typename of the current node (as string)? No, there is no such support. > I'm asking because the alternative way of efficiently determining the > type of any during runtime requires some RTTI which is not portable. I am not sure what you mean by "some RTTI", but standard C++ RTTI (i.e., dynamic_cast, typeid) are very much portable. Some projects may choose to disable this support in order to minimize code size, but that's another story. So if you need a type name in C++/Tree, then typeid(x).name () is the recommended way. If, however, you want to find whether x is of a particular dynamic type, then use dynamic_cast, it will be much faster than any custom RTTI with string comparison: base& x = ... if (derived1* d1 = dynamic_cast (&x)) { // x is derived1 } else if (derived2* d2 = dynamic_cast (&x)) { // x is derived2 } ... else { // x is something else } Boris From neeraj.vaidya at yahoo.co.in Fri Aug 23 12:24:45 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Fri Aug 23 12:24:56 2013 Subject: [xsd-users] error trying to build examples [SOLVED] In-Reply-To: References: <1377091089.76962.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377101702.84632.YahooMailNeo@web194003.mail.sg3.yahoo.com> <1377104413.13448.YahooMailNeo@web194003.mail.sg3.yahoo.com> Message-ID: <1377275085.92572.YahooMailNeo@web194006.mail.sg3.yahoo.com> Hi Boris, Thanks for your advice. I was able to successfully build the libxerces-c.so using g++ as follows : ./configure CXX=g++ CC=g++ --disable-threads --disable-network CXXFLAGS=-O2 CFLAGS=-O2 cd src make [I guess I had not been applying the command line parameters for configure correctly] Then I was able to build the XSD examples by doing the following : Adding /usr/local/lib to the LD_LIBRARY_PATH. (Also, I needed to add the location of the Xerces headers and library built earlier to the make file command line) Adding XSDFLAGS="-liconv" to the make file command line. I am able to run the samples as well. Thanks a lot for your suggestion. I hope this helps other users trying to build on Solaris 10 for Sparc. Regards, Neeraj ________________________________ From: Boris Kolpackov To: Neeraj Vaidya Cc: "xsd-users@codesynthesis.com" Sent: Wednesday, 21 August 2013 11:49 PM Subject: Re: [xsd-users] error trying to build examples Hi Neeraj, Neeraj Vaidya writes: > I built the xerces-3.1.1 source package using the g++ compiler, but > still get the same error. What could be wrong ? You either didn't build it with g++ (did you specify CXX=g++ in configure command line?) or you are still linking to the old library (try removing all copies of libxerces-c.so from your computer except for the one you just built). > But for my information, what is the difference between using > different compilers? I thought if the OS is the same, the built > binaries should work on both platforms. No, the C++ ABIs (i.e., how the symbols are named) as used by g++ and Sun CC are different. Boris From olitour at gmail.com Tue Aug 27 06:05:27 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Tue Aug 27 06:06:14 2013 Subject: [xsd-users] CodeLists handling Message-ID: Hi, I am wondering how can XSD code lists can be handled with cxx-tree. I am working on CityGML 2.0.0 which defines several code lists as gml:Dictionary in xml files. For instance, _AbstractBuilding_roofType.xml defines this kind of entries: flat roof 1000 When I read a gml file which contains information about roof type, I can retrieve, if it exists, the "1000" value. I would like to know how I can make the correspondance between "1000" and "flat roof". Hope you could help. Best regards, Olivier From boris at codesynthesis.com Tue Aug 27 07:02:09 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Aug 27 07:03:23 2013 Subject: [xsd-users] CodeLists handling In-Reply-To: References: Message-ID: Hi Olivier, Olivier Tournaire writes: > > > flat roof > 1000 > > > > When I read a gml file which contains information about roof type, I can > retrieve, if it exists, the "1000" value. I would like to know how I can > make the correspondance between "1000" and "flat roof". I am not sure I see what the problem is. Given the object corresponding to the gml:name element, you can get the containing object (gml:Definition) using the _container() function. Then you can get to gml:description. Boris From olitour at gmail.com Tue Aug 27 07:12:55 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Tue Aug 27 07:13:43 2013 Subject: [xsd-users] CodeLists handling In-Reply-To: References: Message-ID: Thus, all I need to do is to read the xml file containing code lists ? 2013/8/27 Boris Kolpackov > Hi Olivier, > > Olivier Tournaire writes: > > > > > > > flat roof > > 1000 > > > > > > > > When I read a gml file which contains information about roof type, I can > > retrieve, if it exists, the "1000" value. I would like to know how I can > > make the correspondance between "1000" and "flat roof". > > I am not sure I see what the problem is. Given the object corresponding > to the gml:name element, you can get the containing object (gml:Definition) > using the _container() function. Then you can get to gml:description. > > Boris > From neeraj.vaidya at yahoo.co.in Thu Aug 29 13:43:27 2013 From: neeraj.vaidya at yahoo.co.in (Neeraj Vaidya) Date: Thu Aug 29 13:43:36 2013 Subject: [xsd-users] SOAP message serialization using XSD compiler on WSDL Message-ID: <1377798207.95052.YahooMailNeo@web194002.mail.sg3.yahoo.com> Hi, I have a WSDL which defines the layout of SOAP messages that will be exchanged between my application and another. My application is based on C++. Is there a way to generate serialization code using xsd compiler ? When I tried to compile it, it complained that the root element must be "schema". My WSDL contains the following (just a part of the file) : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .... .... Regards, Neeraj