From dolguldur49 at hotmail.com Thu Mar 17 09:45:32 2011 From: dolguldur49 at hotmail.com (Dol Guldur) Date: Thu Mar 17 09:47:44 2011 Subject: [xsde-users] Error building xsde 3.0.0 Message-ID: Hello I recently tried to build xsde for an embedded linux (on ppc440) target using the ELDK g++ cross compiler (version 4.2.2). This is an extract of what we get during the building process : /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:46: error: expected constructor, destructor, or type conversion before '(' token /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:55: error: expected type-specifier before 'allocator' /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:55: error: expected '>' before 'allocator' /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:60: error: template argument 3 is invalid /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:60: error: invalid type in declaration before ';' token /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:68: error: '_GLIBCXX_END_NAMESPACE' does not name a type In file included from /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/cstring:51, from /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/char_traits.h:45, from /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/string:47, from /home/pi21/T?l?chargements/xsde-3.2.0-i686-linux-gnu/libxsde/xsde/cxx/ro-string.hxx:14, [...] /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/cstddef:58: error: '_GLIBCXX_END_NAMESPACE' does not name a type In file included from /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/char_traits.h:45, from /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/string:47, from /home/pi21/T?l?chargements/xsde-3.2.0-i686-linux-gnu/libxsde/xsde/cxx/ro-string.hxx:14, I never even opened any c++ library file before getting this error. It would be grateful if anybody could give me an advice to define the exact nature of the problem. Thanks you Regards Thibault From boris at codesynthesis.com Thu Mar 17 14:27:12 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Mar 17 14:27:37 2011 Subject: [xsde-users] Error building xsde 3.0.0 In-Reply-To: References: Message-ID: Hi Dol, Dol Guldur writes: > I recently tried to build xsde for an embedded linux (on ppc440) target > using the ELDK g++ cross compiler (version 4.2.2). > > This is an extract of what we get during the building process : > > /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/bits/stringfwd.h:68: > error: '_GLIBCXX_END_NAMESPACE' does not name a type There seems to be a problem in the standard C++ library (STL) in your ELDK distribution. _GLIBCXX_END_NAMESPACE macro should have been defined by /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/ppc-linux/bits/c++-config.h You can verify this by trying to compile a simple program like this: #include int main () { std::string str ("test"); } You should see the same errors as when building libxsde. It is also possible to disable the use of STL/iostream in XSD/e. For that you will need to set the following configuration variables in config/config.make to 'n': XSDE_STL XSDE_IOSTREAM Boris From dv7777 at gmail.com Wed Mar 23 14:02:17 2011 From: dv7777 at gmail.com (dv) Date: Wed Mar 23 14:02:28 2011 Subject: [xsde-users] switching from xsd to xsde - questions Message-ID: <4D8A35A9.1050509@gmail.com> Hi, since I need to be able to use a custom XML parser, I am considering to switch to XSD/e. Right now I have been using XSD with the C++/Tree mapping. Now I wonder, how difficult is it to replace XSD with XSD/e? Are both very similar, that is, do their command line options have little differences? What about the generated code? Of course XSD/e differs in how parsing is done/integrated, but other parts seem to differ as well, for example I noticed that XSD/e does not generate any comparison operators. regards From boris at codesynthesis.com Thu Mar 24 13:29:12 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Mar 24 13:30:20 2011 Subject: [xsde-users] switching from xsd to xsde - questions In-Reply-To: <4D8A35A9.1050509@gmail.com> References: <4D8A35A9.1050509@gmail.com> Message-ID: Hi, dv writes: > Right now I have been using XSD with the C++/Tree mapping. > Now I wonder, how difficult is it to replace XSD with XSD/e? Are both > very similar, that is, do their command line options have little > differences? What about the generated code? C++/Tree and C++/Hybrid are similar in the sense that they both represent XML as an in-memory, tree-like object model. The implementations of the mappings, however, are quite different. In particular, C++/Hybrid is more minimal since it is targeted at mobile/embedded/light-weight applications. So if you have some code that uses C++/Tree simply recompiling the schemas will not work. You will need to do some porting work. Though, since the programming models are similar, this shouldn't be too difficult. > Of course XSD/e differs in how parsing is done/integrated, but other > parts seem to differ as well, for example I noticed that XSD/e does not > generate any comparison operators. Right, there are quite a few "extras" provided by C++/Tree (comparison operators, ostream operators, DOM association, XPath) that are not present in C++/Hybrid. Boris From boris at codesynthesis.com Thu Mar 24 13:34:18 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Mar 24 13:35:26 2011 Subject: [xsde-users] Error building xsde 3.0.0 In-Reply-To: References: Message-ID: Hi, [CC'ed xsde-users in case someone else runs into the same problem.] Dol Guldur writes: > Sorry for the delay, the code you gave for testing c++ library doesn't > seem to cause any trouble when compiling: > > #include "/opt/eldk/ppc_4xx/usr/include/c++/4.2.2/string" > //#include > > int main () > { > std::string str ("test"); > } > > powerpc-linux-g++ ./test.cpp > > And i haven't any file called like that : > > /home/pi21/eldklinux/ppc_4xx/usr/include/c++/4.2.2/ppc-linux/bits/c++config.h > > whereas I have an #include in [...]/bits/stringfwd.h !! > > I don't know how it's possible that the eldk tool is incomplete Ok, I think I know what's going on. Your powerpc-linux-g++ cross-compiler probably uses incorrect include path to find . It is most likely using your native compiler's headers (I presume that's why you put absolute path instead of #include). The way to make powerpc-linux-g++ use the correct headers would be to add: -I/opt/eldk/ppc_4xx/usr/include/c++/4.2.2/ To the CPPFLAGS variable in etc/config.make in XSD/e. Can you try this and see if it helps? Boris From matthias.maschek at uma.at Fri Mar 25 05:08:23 2011 From: matthias.maschek at uma.at (Matthias Maschek) Date: Fri Mar 25 04:09:47 2011 Subject: [xsde-users] XML Serialization fails Message-ID: <4c99c5996d173206.4d8c6997@sun.uma.at> Hello! I have a little problem with serialization. I generated the class files via Hybrid like in the Hello World tutorial (xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd). After that i tried to get the implementation running in my code. But when i try to parse an XML i always get a unexpected element encountered exception on the first contained element of the root element. I tripple checked already the XML file against the XSD via validators and there is no error. What i had problems with was the line from the tutorial: xml_schema::document_pimpl doc_p (hello_p.root_parser (), hello_p.root_name ()); document_pimpl did not exist in that namespace. The only document_pimpl i found was in: xsde::cxx::parser::expat::document_pimpl doc(paggr.root_parser(), paggr.root_name()); Could that be the problem? And if yes: Whats wrong? Do you need more info? Thanks, Matthias From boris at codesynthesis.com Fri Mar 25 09:46:22 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 25 09:47:37 2011 Subject: [xsde-users] XML Serialization fails In-Reply-To: <4c99c5996d173206.4d8c6997@sun.uma.at> References: <4c99c5996d173206.4d8c6997@sun.uma.at> Message-ID: Matthias, Matthias Maschek writes: > I have a little problem with serialization. I generated the class files > via Hybrid like in the Hello World tutorial > (xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd). After > that i tried to get the implementation running in my code. But when i > try to parse an XML i always get a unexpected element encountered > exception on the first contained element of the root element. Are you having problems with parsing or serialization? In the email's subject and at the beginning of the above paragraph you say serialization. In the last sentence you say parsing. Which one is it? > I tripple checked already the XML file against the XSD via validators > and there is no error. What i had problems with was the line from the > tutorial: > xml_schema::document_pimpl doc_p (hello_p.root_parser (), > hello_p.root_name ()); > > document_pimpl did not exist in that namespace. That's very odd. What is the exact command line you used to compile the schema? If it includes --generate-parser and --generate-aggregate options, then xml_schema::document_pimpl should be defined in the -pimpl.hxx header file. Regarding the unexpected element error, if your schema uses namespaces (has targetNamespace attribute), then you also need to provide the root namespace to the parser: xml_schema::document_pimpl doc_p (hello_p.root_parser (), hello_p.root_namespace (), hello_p.root_name ()); Boris From matthias.maschek at uma.at Fri Mar 25 12:09:06 2011 From: matthias.maschek at uma.at (Matthias Maschek) Date: Fri Mar 25 11:10:31 2011 Subject: [xsde-users] XML Serialization fails In-Reply-To: References: <4c99c5996d173206.4d8c6997@sun.uma.at> Message-ID: <167133c874e2c1d6.4d8ccc32@sun.uma.at> Hi! Yes, i meant parsing, the title was quite misleading, sorry! Actually i used the commandline i had posted xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd And yes, my XSD and XML are using namespaces. The tip with using the third parameter is godd, i just can try it out on monday. Thanks! Matthias ----- Urspr?ngliche Nachricht ----- Von: Boris Kolpackov Datum: Freitag, M?rz 25, 2011 3:46 pm Betreff: Re: [xsde-users] XML Serialization fails An: Matthias Maschek Cc: xsde-users@codesynthesis.com > Matthias, > > Matthias Maschek writes: > > > I have a little problem with serialization. I generated the class > files > > via Hybrid like in the Hello World tutorial > > (xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd). After > > that i tried to get the implementation running in my code. But when > i > > try to parse an XML i always get a unexpected element encountered > > exception on the first contained element of the root element. > > Are you having problems with parsing or serialization? In the email's > subject and at the beginning of the above paragraph you say serialization. > In the last sentence you say parsing. Which one is it? > > > > I tripple checked already the XML file against the XSD via validators > > and there is no error. What i had problems with was the line from the > > tutorial: > > xml_schema::document_pimpl doc_p (hello_p.root_parser (), > > hello_p.root_name ()); > > > > document_pimpl did not exist in that namespace. > > That's very odd. What is the exact command line you used to compile > the schema? If it includes --generate-parser and --generate-aggregate > options, then xml_schema::document_pimpl should be defined in the > -pimpl.hxx header file. > > Regarding the unexpected element error, if your schema uses namespaces > (has targetNamespace attribute), then you also need to provide the > root namespace to the parser: > > xml_schema::document_pimpl doc_p (hello_p.root_parser (), > hello_p.root_namespace (), > hello_p.root_name ()); > > Boris