From boris at codesynthesis.com Wed Feb 4 02:11:58 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Feb 4 02:15:09 2009 Subject: [xsde-users] XSD/e 3.0.0 released Message-ID: <20090204071158.GC836@karelia> Hi, We have released XSD/e 3.0.0. This is a major release which introduces the new Embedded C++/Hybrid mapping. C++/Hybrid provides a light-weight, tree-like object model on top of the C++/Parser and C++/Serializer mappings. It supports fully in- memory as well as hybrid, partially even-driven, partially in-memory XML processing. Other major features of this mapping include: * Precise reproduction of the XML vocabulary structure and element order. * Support for filtering of XML data during parsing and object model during serialization. * Customizable object model classes as well as parsing and serialization code. * Small memory footprint, including heap and stack usage. * Highly-portable, can be used without STL, RTTI, iostream, C++ exceptions, and with minimal use of C++ templates. For more information refer to the Embedded C++/Hybrid Mapping page: http://www.codesynthesis.com/products/xsde/c++/hybrid/ For a quick introduction to the mapping, refer to the Embedded C++/Hybrid Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/ Other NEWS file entries for this release are as follows: * New option, --disable-warning, disables printing of a warning with the specified id. Specifying 'all' for the warning id disables all warnings. * The interfaces of the non-STL versions of the xml_schema::qname and xml_schema::string_sequence classes have changed. Now by default their modifier functions assume ownership of the passed strings. The *_copy() versions of the modifier functions that make copies of the passed strings are now provided. See the documentation for details. * The implementation of the STL version of the xml_schema::string_sequence class has changed. Now a custom implementation of the sequence container is used instead of std::vector. See the documentation for details. * When STL is enabled the xml_schema::string_sequence objects corresponding to the NMTOKENS and IDREFS types are now returned and passed by pointer rather than by value. This release also adds official support for QNX 6.x, iPhone OS 2.x, and Visual Studio 2008 with Smart Devices. For a complete list of supported platforms and toolchains, refer to the Platforms page: http://www.codesynthesis.com/products/xsde/platforms.xhtml Precompiled binary distributions are available from the product's Download page: http://www.codesynthesis.com/products/xsde/download.xhtml Source code for this release is available from the project's page: http://www.codesynthesis.com/projects/xsde/ SHA1 checksums for the files: a7c404aa1473ea9334b2fadbc7b89adbc2b9195f xsde-3.0.0.tar.bz2 b66f665ec950afd3eb838eeb71c616fcf7513e4f xsde-3.0.0-i686-linux-gnu.tar.bz2 dab7f7deff45b731ee64b376b8411fe492c1047a xsde-3.0.0-i686-macosx.tar.bz2 4a514a01db87c203a5322594511b1f60c120a873 xsde-3.0.0-sparc-solaris.tar.gz b40b39cf668b81807056320feb494f5cd9b18e4d xsde-3.0.0-i686-windows.zip Enjoy, Boris From filippo.dellabetta at telecomitalia.it Fri Feb 6 08:43:51 2009 From: filippo.dellabetta at telecomitalia.it (Della Betta Filippo) Date: Fri Feb 6 08:43:57 2009 Subject: [xsde-users] XSD/e 3.0.0 released In-Reply-To: <20090204071158.GC836@karelia> References: <20090204071158.GC836@karelia> Message-ID: <04DCF02F0CBEDE4F9A314586514023ABA445BCEBFD@GRFMBX702BA020.griffon.local> Dear Boris, first of all thank you for your excellent work. I like the hybrid mapping very much. I faced some problem with xsd and xml attached. After generating code with # xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate --no-long-long --cxx-suffix .cpp --hxx-suffix .h --location-map http://www.w3.org/2001/xml.xsd=xml.xsd --namespace-map urn:ietf:params:xml:ns:resource-lists=urn_ietf_params_xml_ns_resource_lists --namespace-map http://www.w3.org/2001/xml.xsd=xml_xsd resource-lists_rfc4826.xsd # xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate --no-long-long --cxx-suffix .cpp --hxx-suffix .h --namespace-map http://www.w3.org/2001/xml.xsd=xml_xsd xml.xsd I wrote the following program to test hybrid / aggregate functionality. While printing the name for "2nd level" list (see rl.xml), I got access violation (windows, visual studio 2008). Did I do something wrong ? Thanks in advance Regards, Filippo #include #include #include #include "resource-lists_rfc4826.h" #include "resource-lists_rfc4826-pimpl.h" #include "resource-lists_rfc4826-simpl.h" using namespace std; using namespace urn_ietf_params_xml_ns_resource_lists; int main (int argc, char* argv[]) { try { resource_lists_paggr resource_lists_p; ::xml_schema::document_pimpl doc_p ( resource_lists_p.root_parser(), resource_lists_p.root_namespace(), resource_lists_p.root_name() ); resource_lists_p.pre (); ifstream i("rl.xml"); doc_p.parse (i); resource_lists* rl = resource_lists_p.post (); for ( resource_lists::sequence_iterator si = rl->sequence().begin(); si != rl->sequence().end(); si++){ for ( listType::sequence_iterator li = si->list().sequence().begin(); li != si->list().sequence().end(); li++){ switch (li->choice_arm()){ case listType::sequence_type::list_tag: cout << "list name = " << li->list().name() << endl; default: break; } } } delete rl; } catch (const xml_schema::parser_exception& e) { cerr << e.line () << ":" << e.column () << ": " << e.text () << endl; return 1; } } -----Original Message----- From: xsde-users-bounces@codesynthesis.com [mailto:xsde-users-bounces@codesynthesis.com] On Behalf Of Boris Kolpackov Sent: mercoled? 4 febbraio 2009 8.12 To: xsde-users@codesynthesis.com Subject: [xsde-users] XSD/e 3.0.0 released Hi, We have released XSD/e 3.0.0. This is a major release which introduces the new Embedded C++/Hybrid mapping. C++/Hybrid provides a light-weight, tree-like object model on top of the C++/Parser and C++/Serializer mappings. It supports fully in- memory as well as hybrid, partially even-driven, partially in-memory XML processing. Other major features of this mapping include: * Precise reproduction of the XML vocabulary structure and element order. * Support for filtering of XML data during parsing and object model during serialization. * Customizable object model classes as well as parsing and serialization code. * Small memory footprint, including heap and stack usage. * Highly-portable, can be used without STL, RTTI, iostream, C++ exceptions, and with minimal use of C++ templates. For more information refer to the Embedded C++/Hybrid Mapping page: http://www.codesynthesis.com/products/xsde/c++/hybrid/ For a quick introduction to the mapping, refer to the Embedded C++/Hybrid Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/ Other NEWS file entries for this release are as follows: * New option, --disable-warning, disables printing of a warning with the specified id. Specifying 'all' for the warning id disables all warnings. * The interfaces of the non-STL versions of the xml_schema::qname and xml_schema::string_sequence classes have changed. Now by default their modifier functions assume ownership of the passed strings. The *_copy() versions of the modifier functions that make copies of the passed strings are now provided. See the documentation for details. * The implementation of the STL version of the xml_schema::string_sequence class has changed. Now a custom implementation of the sequence container is used instead of std::vector. See the documentation for details. * When STL is enabled the xml_schema::string_sequence objects corresponding to the NMTOKENS and IDREFS types are now returned and passed by pointer rather than by value. This release also adds official support for QNX 6.x, iPhone OS 2.x, and Visual Studio 2008 with Smart Devices. For a complete list of supported platforms and toolchains, refer to the Platforms page: http://www.codesynthesis.com/products/xsde/platforms.xhtml Precompiled binary distributions are available from the product's Download page: http://www.codesynthesis.com/products/xsde/download.xhtml Source code for this release is available from the project's page: http://www.codesynthesis.com/projects/xsde/ SHA1 checksums for the files: a7c404aa1473ea9334b2fadbc7b89adbc2b9195f xsde-3.0.0.tar.bz2 b66f665ec950afd3eb838eeb71c616fcf7513e4f xsde-3.0.0-i686-linux-gnu.tar.bz2 dab7f7deff45b731ee64b376b8411fe492c1047a xsde-3.0.0-i686-macosx.tar.bz2 4a514a01db87c203a5322594511b1f60c120a873 xsde-3.0.0-sparc-solaris.tar.gz b40b39cf668b81807056320feb494f5cd9b18e4d xsde-3.0.0-i686-windows.zip Enjoy, Boris Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie. This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: rl.xml Type: text/xml Size: 780 bytes Desc: rl.xml Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20090206/c46229d2/rl.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: resource-lists_rfc4826.xsd Type: text/xml Size: 3166 bytes Desc: resource-lists_rfc4826.xsd Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20090206/c46229d2/resource-lists_rfc4826.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: xml.xsd Type: text/xml Size: 5840 bytes Desc: xml.xsd Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20090206/c46229d2/xml.bin From boris at codesynthesis.com Fri Feb 6 10:07:15 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 6 10:10:47 2009 Subject: [xsde-users] XSD/e 3.0.0 released In-Reply-To: <04DCF02F0CBEDE4F9A314586514023ABA445BCEBFD@GRFMBX702BA020.griffon.local> References: <20090204071158.GC836@karelia> <04DCF02F0CBEDE4F9A314586514023ABA445BCEBFD@GRFMBX702BA020.griffon.local> Message-ID: Hi Filippo, Della Betta Filippo writes: > first of all thank you for your excellent work. I like the hybrid > mapping very much. Thank you. I am glad you like it. > I wrote the following program to test hybrid / aggregate functionality. > While printing the name for "2nd level" list (see rl.xml), I got access > violation (windows, visual studio 2008). I checked your schema and XML and it appears that it has a recursive element (list). One of the current limitations of the generated parsing code in the C++/Hybrid mapping is that it does not yet support recursive parsing. This will be supported in the next release, though. One work around would be to provide custom parser implementations for the types involved in the recursion. In your schema they are list (the anonymous type for the list element inside listType) and listType. I've created a sample implementation for you which you can download via this URI: http://www.codesynthesis.com/~boris/tmp/resource-list-rfc4826.zip Here is what I did: I copied the generated parser implementations for list and listType to list-pimpl.h/cpp and listType-pimpl.h/cpp. I then changed them to maintain a stack of states instead of just one state. I used STL stack for simplicity, though you can use the POD stack class found in libxsde/xsde/cxx/parser/state.hxx if STL is not available (this is what we are going to use in the implementation for the next release; that stack is also optimized for the non-recursive case). Then I used the --custom-parser option to instruct the XSD/e compiler to use my custom implementations instead of the generated ones (see the cmd.txt file in the archive for the updated XSD/e command line). After that your test driver works as expected. For more information on parser customization see Section 6.1, "Customizing Parsers and Serializers" in the Embedded C++/Hybrid Mapping Getting Started Guide. Boris From filippo.dellabetta at telecomitalia.it Mon Feb 9 08:16:34 2009 From: filippo.dellabetta at telecomitalia.it (Della Betta Filippo) Date: Mon Feb 9 08:16:42 2009 Subject: [xsde-users] XSD/e 3.0.0 released In-Reply-To: References: <20090204071158.GC836@karelia> <04DCF02F0CBEDE4F9A314586514023ABA445BCEBFD@GRFMBX702BA020.griffon.local> Message-ID: <04DCF02F0CBEDE4F9A314586514023ABA445BCEC07@GRFMBX702BA020.griffon.local> Thanks! I did the same for the serializer (providing a new implementation for listType_simpl and list_simpl with --custom-serializer, putting a std::stack of state and implementing post() callback to do pop() on the stack). Attached the custom implementation files. Do you think it is the correct way to do this ? Filippo P.S. driver program following #include #include #include #include "resource-lists_rfc4826.h" #include "resource-lists_rfc4826-pimpl.h" #include "resource-lists_rfc4826-simpl.h" using namespace std; using namespace urn_ietf_params_xml_ns_resource_lists; int main (int argc, char* argv[]) { try { resource_lists_paggr resource_lists_p; ::xml_schema::document_pimpl doc_p ( resource_lists_p.root_parser(), resource_lists_p.root_namespace(), resource_lists_p.root_name() ); resource_lists_p.pre (); ifstream i("rl.xml"); doc_p.parse (i); resource_lists* rl = resource_lists_p.post (); for ( resource_lists::sequence_iterator si = rl->sequence().begin(); si != rl->sequence().end(); si++){ for ( listType::sequence_iterator li = si->list().sequence().begin(); li != si->list().sequence().end(); li++){ switch (li->choice_arm()){ case listType::sequence_type::list_tag: { cout << "list name = " << li->list().name() << endl; for ( listType::sequence_iterator li2 = li->list().sequence().begin(); li2 != li->list().sequence().end(); li2++){ switch (li->choice_arm()){ case listType::sequence_type::list_tag: cout << "list name = " << li2->list().name() << endl; break; case listType::sequence_type::entry_tag: cout << "entry uri = " << li2->entry().uri() << endl; break; default: break; } } } break; default: break; } } } resource_lists_saggr resource_lists_s; ::xml_schema::document_simpl doc_s ( resource_lists_s.root_serializer(), resource_lists_s.root_namespace(), resource_lists_s.root_name() ); resource_lists_s.pre(*rl); ofstream o("rlgen.xml"); doc_s.add_prefix("","urn:ietf:params:xml:ns:resource-lists"); doc_s.serialize(o); resource_lists_s.post(); delete rl; } catch (const xml_schema::parser_exception& e) { cerr << e.line () << ":" << e.column () << ": " << e.text () << endl; return 1; } catch (const xml_schema::serializer_exception& e) { cerr << "error: " << e.text () << endl; return 1; } } -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: venerd? 6 febbraio 2009 16.07 To: Della Betta Filippo Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] XSD/e 3.0.0 released Hi Filippo, Della Betta Filippo writes: > first of all thank you for your excellent work. I like the hybrid > mapping very much. Thank you. I am glad you like it. > I wrote the following program to test hybrid / aggregate functionality. > While printing the name for "2nd level" list (see rl.xml), I got access > violation (windows, visual studio 2008). I checked your schema and XML and it appears that it has a recursive element (list). One of the current limitations of the generated parsing code in the C++/Hybrid mapping is that it does not yet support recursive parsing. This will be supported in the next release, though. One work around would be to provide custom parser implementations for the types involved in the recursion. In your schema they are list (the anonymous type for the list element inside listType) and listType. I've created a sample implementation for you which you can download via this URI: http://www.codesynthesis.com/~boris/tmp/resource-list-rfc4826.zip Here is what I did: I copied the generated parser implementations for list and listType to list-pimpl.h/cpp and listType-pimpl.h/cpp. I then changed them to maintain a stack of states instead of just one state. I used STL stack for simplicity, though you can use the POD stack class found in libxsde/xsde/cxx/parser/state.hxx if STL is not available (this is what we are going to use in the implementation for the next release; that stack is also optimized for the non-recursive case). Then I used the --custom-parser option to instruct the XSD/e compiler to use my custom implementations instead of the generated ones (see the cmd.txt file in the archive for the updated XSD/e command line). After that your test driver works as expected. For more information on parser customization see Section 6.1, "Customizing Parsers and Serializers" in the Embedded C++/Hybrid Mapping Getting Started Guide. Boris Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie. This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks. -------------- next part -------------- #include "resource-lists_rfc4826-simpl.h" namespace urn_ietf_params_xml_ns_resource_lists { list_simpl:: list_simpl () : list_sskel (&base_impl_) { } void list_simpl:: pre (const ::urn_ietf_params_xml_ns_resource_lists::list& x) { this->base_impl_.pre (x); this->list_simpl_state_.push( list_simpl_state() ); this->list_simpl_state_.top ().list_ = &x; } void list_simpl:: post () { this->list_simpl_state_.pop(); } } -------------- next part -------------- #include namespace urn_ietf_params_xml_ns_resource_lists { class list_simpl: public list_sskel { public: list_simpl (); virtual void pre (const ::urn_ietf_params_xml_ns_resource_lists::list&); virtual void post (); protected: struct list_simpl_state { const ::urn_ietf_params_xml_ns_resource_lists::list* list_; }; std::stack < list_simpl_state > list_simpl_state_; protected: ::urn_ietf_params_xml_ns_resource_lists::listType_simpl base_impl_; }; } -------------- next part -------------- #include "resource-lists_rfc4826-simpl.h" namespace urn_ietf_params_xml_ns_resource_lists { void listType_simpl:: pre (const ::urn_ietf_params_xml_ns_resource_lists::listType& x) { this->listType_simpl_state_.push( listType_simpl_state() ); this->listType_simpl_state_.top ().listType_ = &x; this->listType_simpl_state_.top ().sequence_end_ = this->listType_simpl_state_.top ().listType_->sequence ().end (); this->listType_simpl_state_.top ().sequence_ = this->listType_simpl_state_.top ().sequence_end_; } void listType_simpl:: post() { this->listType_simpl_state_.pop(); } bool listType_simpl:: name_present () { return this->listType_simpl_state_.top ().listType_->name_present (); } ::std::string listType_simpl:: name () { return this->listType_simpl_state_.top ().listType_->name (); } bool listType_simpl:: display_name_present () { return this->listType_simpl_state_.top ().listType_->display_name_present (); } const ::urn_ietf_params_xml_ns_resource_lists::display_nameType& listType_simpl:: display_name () { return this->listType_simpl_state_.top ().listType_->display_name (); } bool listType_simpl:: sequence_next () { if (this->listType_simpl_state_.top ().sequence_ != this->listType_simpl_state_.top ().sequence_end_) this->listType_simpl_state_.top ().sequence_++; else this->listType_simpl_state_.top ().sequence_ = this->listType_simpl_state_.top ().listType_->sequence ().begin (); if (this->listType_simpl_state_.top ().sequence_ != this->listType_simpl_state_.top ().sequence_end_) { return true; } else return false; } listType_sskel::choice_arm_tag listType_simpl:: choice_arm () { choice_arm_tag t (static_cast< choice_arm_tag > ( this->listType_simpl_state_.top ().sequence_->choice_arm ())); return t; } const ::urn_ietf_params_xml_ns_resource_lists::list& listType_simpl:: list () { return this->listType_simpl_state_.top ().sequence_->list (); } const ::urn_ietf_params_xml_ns_resource_lists::externalType& listType_simpl:: external () { return this->listType_simpl_state_.top ().sequence_->external (); } const ::urn_ietf_params_xml_ns_resource_lists::entryType& listType_simpl:: entry () { return this->listType_simpl_state_.top ().sequence_->entry (); } const ::urn_ietf_params_xml_ns_resource_lists::entry_refType& listType_simpl:: entry_ref () { return this->listType_simpl_state_.top ().sequence_->entry_ref (); } } -------------- next part -------------- #include namespace urn_ietf_params_xml_ns_resource_lists { class listType_simpl: public listType_sskel { public: virtual void pre (const ::urn_ietf_params_xml_ns_resource_lists::listType&); virtual void post(); // Attributes. // virtual bool name_present (); virtual ::std::string name (); // Elements. // virtual bool display_name_present (); virtual const ::urn_ietf_params_xml_ns_resource_lists::display_nameType& display_name (); virtual bool sequence_next (); virtual choice_arm_tag choice_arm (); virtual const ::urn_ietf_params_xml_ns_resource_lists::list& list (); virtual const ::urn_ietf_params_xml_ns_resource_lists::externalType& external (); virtual const ::urn_ietf_params_xml_ns_resource_lists::entryType& entry (); virtual const ::urn_ietf_params_xml_ns_resource_lists::entry_refType& entry_ref (); protected: struct listType_simpl_state { const ::urn_ietf_params_xml_ns_resource_lists::listType* listType_; ::urn_ietf_params_xml_ns_resource_lists::listType::sequence_const_iterator sequence_; ::urn_ietf_params_xml_ns_resource_lists::listType::sequence_const_iterator sequence_end_; }; std::stack < listType_simpl_state > listType_simpl_state_; }; } From boris at codesynthesis.com Mon Feb 9 08:41:57 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 9 08:45:58 2009 Subject: [xsde-users] XSD/e 3.0.0 released In-Reply-To: <04DCF02F0CBEDE4F9A314586514023ABA445BCEC07@GRFMBX702BA020.griffon.local> References: <20090204071158.GC836@karelia> <04DCF02F0CBEDE4F9A314586514023ABA445BCEBFD@GRFMBX702BA020.griffon.local> <04DCF02F0CBEDE4F9A314586514023ABA445BCEC07@GRFMBX702BA020.griffon.local> Message-ID: Hi Filippo, Della Betta Filippo writes: > I did the same for the serializer (providing a new implementation > for listType_simpl and list_simpl with --custom-serializer, putting > a std::stack of state and implementing post() callback to do pop() > on the stack). Attached the custom implementation files. Do you think > it is the correct way to do this ? The only problem with your implementation that I can see is that you don't call listType_simpl::post() from list_simpl::post(). This way, the state stack will keep growing if you reuse the serializer. Also, since the list type itself does not have any elements or attributes, list_simpl doesn't really need any state. I am attaching the modified list-simpl.* files for your reference. The test driver produces the output XML identical to the input. Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: list-simpl.h Type: text/x-chdr Size: 350 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20090209/5949688c/list-simpl.h -------------- next part -------------- A non-text attachment was scrubbed... Name: list-simpl.cpp Type: text/x-c++src Size: 358 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20090209/5949688c/list-simpl.cpp From boris at codesynthesis.com Sun Feb 15 09:20:35 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Feb 15 09:25:23 2009 Subject: [xsde-users] Posting guidelines Message-ID: Hi, We have created a page which lists a few basic guidelines that we would like you to follow when posting to the mailing lists hosted by Code Synthesis: http://www.codesynthesis.com/support/posting-guidelines.xhtml As an incentive to follow these guidelines, Code Synthesis staff assigns higher priority to questions that do not violate any of the listed rules. Boris From mikael.bexar at tke.fi Tue Feb 17 08:55:46 2009 From: mikael.bexar at tke.fi (Mikael Bexar) Date: Tue Feb 17 08:56:33 2009 Subject: [xsde-users] xerces-c-3.0.0 + windows Mobile 6.0 Message-ID: <000801c99107$6f02e8b0$4d08ba10$@bexar@tke.fi> I am developing an aplication in Windows Mobile 6.0 MFC with Visual studio 8.0. Can i use xerces-c-3.0.0 to parse xml documents in my projekt and if i can, could you please tell me how to do this? Any examples? /Mikael From boris at codesynthesis.com Tue Feb 17 09:09:51 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 17 09:15:04 2009 Subject: [xsde-users] xerces-c-3.0.0 + windows Mobile 6.0 Message-ID: Hi Mikael, Mikael Bexar writes: > Can i use xerces-c-3.0.0 to parse xml documents [...] This mailing list is for discussions about XSD/e, not Xerces-C++. For Xerces-C++, I suggest that you use one of the project's mailing lists: http://xerces.apache.org/xerces-c/mailing-lists.html Boris From boris at codesynthesis.com Tue Feb 17 14:13:26 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 17 14:18:34 2009 Subject: [xsde-users] Debug version of xsde.lib on Windows In-Reply-To: <25034.44772.qm@web54603.mail.re2.yahoo.com> References: <25034.44772.qm@web54603.mail.re2.yahoo.com> Message-ID: Hi Anatoly, I've CC'ed xsde-user to my reply in case this information will be useful to someone else. Anatoly Borodyansky writes: > How could I build static debug version of xsde.lib? You can add /Od /MDd /ZI to the CFLAGS and CXXFLAGS variables in config/config.nmake. I copied these options from a test Win32 project I created in VC++ 8.0. I then linked the xsde.lib library to this test project and could step into the code in xsde.lib in the debugger. Note that you may want to check which one of the /MDd or /MTd options is used in your application and use that to build xsde.lib. Boris From sir.costy at gmail.com Wed Feb 18 09:43:43 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Wed Feb 18 09:43:50 2009 Subject: [xsde-users] XSDe multi platform issue - iPhone, Windows x86, MacOSX Message-ID: Hello, In the weeks I had spent a couple of time, more than a lot, trying to find a solution to my working application for multi platform using of XSD/XSDe to C++ data binding. Since I get stuck here I would appreciate if some one can help me. What I mean. We are working to a technical application which involves the possibility of importing/exporting data information using the XML format defined on Geography Markup Language / LandXML standard schema. The bad thing is that the core of the application is designed to run on Windows, MacOSX and iPhone operating systems. So it is demanded to be written using the standard C++ and to not depend on other external libraries. The idea is that we need of having a single one version of data binding sources codes which can be compiled on the any of the platform mentioned before. After compiling the library on whole operating systems, trying to configure it for each one of them, and running the examples I did not found a C++ data binding sources codes that achieves those goals. The generated files are so closer depending of the platform where there are compiled. So the only and the best solution which I can see is getting a way to compile the XSDe for Windows/MacOSX. So do not have only a compilation for embedded systems. This would make the source codes some kind independently of the platform - because of using of the same library. What do you think? There is possible to compile the XSDe for Windows Operating System and not only for WinCE? The exactly of which I am looking for is having a statically library, a Windows x86 version of "xsde.lib". Some help and guidance will be gratefully appreciated. Best Regards, Constantin Iacobescu From boris at codesynthesis.com Wed Feb 18 10:20:19 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Feb 18 10:25:34 2009 Subject: [xsde-users] Serialization with indentation In-Reply-To: <160041.56618.qm@web54607.mail.re2.yahoo.com> References: <160041.56618.qm@web54607.mail.re2.yahoo.com> Message-ID: Hi Anatoly, [CC'ed xsde-users] Anatoly Borodyansky writes: > The issue I'm having is when I'm serializing object using hybrid model, > there is no line feeds/ hierarchy whatsoever (same happens in streaming > example) am I missing something, or this is by design? This is by design. XSD/e is primarily targeted at embedded systems and provides only essential functionality to minimize size. It is, however, quite easy to add custom indentation of XML using the xml_schema::writer interface (see Section 8.1, "Document Serializer" in the Embedded C++/Serializer Getting Started Guide). Below is an implementation that I came up with. You would need to "chain" it to an actual writer which writes to a file or stream (see ostream_write and ostream_flush functions in libxsde/xsde/cxx/serializer/genx/document.cxx for an example on how to write to std::ostream). Boris struct indenter: xml_schema::writer { indenter (xml_schema::writer& next) : state_ (in_doc), depth_ (0), simple_ (true), next_ (next) { } virtual void write (const char* s, size_t n) { if (state_ == in_doc) doc (s, n); else tag (s, n); } virtual void flush () { next_.flush (); } private: void doc (const char* s, size_t n) { using xml_schema::ro_string; // Look for the next '<' // ro_string str (s, n); size_t p = str.find ('<'); if (p == ro_string::npos) { next_.write (s, n); return; } // Don't write '<'. // if (p != 0) next_.write (s, p); s += p + 1; n -= p + 1; state_ = in_tag; if (n != 0) tag (s, n); } void tag (const char* s, size_t n) { using xml_schema::ro_string; // If we don't know what kind of tag we are in, sort it out // first. Also output newlines and indentation. // if (state_ == in_tag) { if (*s == '/') { s++; n--; depth_--; state_ = in_ctag; if (!simple_) indent (); next_.write ("'); if (p == ro_string::npos) { next_.write (s, n); return; } next_.write (s, p + 1); s += p + 1; n -= p + 1; state_ = in_doc; if (n != 0) doc (s, n); } void indent () { next_.write ("\n", 1); for (size_t i = 0; i < depth_; ++i) next_.write (" ", 2); } private: enum state { in_doc, in_tag, in_otag, in_ctag, }; state state_; size_t depth_; bool simple_; xml_schema::writer& next_; }; From boris at codesynthesis.com Wed Feb 18 10:51:42 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Feb 18 10:56:57 2009 Subject: [xsde-users] XSDe multi platform issue - iPhone, Windows x86, MacOSX In-Reply-To: References: Message-ID: Hi Constantin, Constantin Iacobescu writes: > So the only and the best solution which I can see is getting a way to > compile the XSDe for Windows/MacOSX. So do not have only a compilation for > embedded systems. This would make the source codes some kind independently > of the platform - because of using of the same library. What do you think? I think this is theoretically possible. The only problem that I see is in the schema that you are planning to use. GML, at least version 3.1.1, uses XML Schema polymorphism in the form of substitutions groups. This feature is not yet supported in XSD/e (planned for the next release). XSD is known to work with GML but it may be a bit too big for iPhone (at least the Xerces-C++ part of it). One solution could be to use binary serialization instead of XML for the iPhone <-> Windows/MacOSX communications. You can then get rid of the Xerces-C++ dependency altogether though this will require a bit of work (one person has already done this so you could reuse some of his results). > There is possible to compile the XSDe for Windows Operating System > and not only for WinCE? Yes, definitely. We test each release with non-embedded VC++ 7.1, 8.0, and 9.0. You can use the default config.nmake in the config/ directory. Then open a command prompt, run vcvars32.bat (normally in C:\Program Files\Microsoft Visual Studio XXX\VC\bin\vcvars32.bat), CD to xsde-x.y.z-i686-windows and run: nmake /f nmakefile Boris From tgrowney at namcobandaigames.com Thu Feb 19 19:30:22 2009 From: tgrowney at namcobandaigames.com (Todd Growney) Date: Fri Feb 20 01:42:50 2009 Subject: [xsde-users] Source for code code generator? Message-ID: I have downloaded the source code for the XSD/e project. This seems to only contain the code for libxsde.lib How can I get the code for xsde.exe? -Todd From boris at codesynthesis.com Fri Feb 20 06:07:47 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Feb 20 06:13:34 2009 Subject: [xsde-users] Source for code code generator? In-Reply-To: References: Message-ID: Hi Todd, Todd Growney writes: > I have downloaded the source code for the XSD/e project. This > seems to only contain the code for libxsde.lib How can I get > the code for xsde.exe? It seem you have downloaded a binary distribution which contains pre-built XSD/e compiler for a specific host development platform (presumably Windows) and source code for the runtime library and examples. Source code for the compiler itself, prerequisites information, as well as build instructions for UNIX and Windows are available from the XSD/e project page: http://www.codesynthesis.com/projects/xsde/ Boris From sir.costy at gmail.com Fri Feb 27 03:25:47 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Fri Feb 27 03:25:57 2009 Subject: [xsde-users] Cxx-Tree binding the LandXML schema - Help accessint the elements data Message-ID: Hello, I'm a bit beginner with XML parsing and less with XSD, so some help would be appreciated. I'm using Windows version of XSD Cxx-Tree for binding the LandXML schema and so on the binding was without errors. This is the command line used: xsd cxx-tree --generate-serialization --generate-polymorphic --generate-doxygen --generate-wildcard --generate-ostream --type-naming java --function-naming java --file-per-type --namespace-map http://www.landxml.org/schema/LandXML-1.0=LandXML_10 LandXML-1.0.xsd Then I'm parsing some xml file and display the content on the screen. Striped code should be some like this: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// using namespace xercesc; XMLPlatformUtils::Initialize (); try { namespace xml = xsd::cxx::xml; std::auto_ptr objLandXML ( LandXML_10::parseLandXML(argv[1], xml_schema::Flags::dont_initialize)); LandXML_10::LandXML::CgPointsSequence& cgPoints(objLandXML->getCgPoints()); for (LandXML_10::LandXML::CgPointsIterator ptsIter(cgPoints.begin()); ptsIter != cgPoints.end (); ++ptsIter) { LandXML_10::CgPoints::NameOptional& optName(ptsIter->getName()); if (optName.present()) cerr <<"name:"<< optName.get() << endl; LandXML_10::CgPoints::CgPointSequence cgPoint(ptsIter->getCgPoint()); for (LandXML_10::CgPoints::CgPointIterator ptIter(cgPoint.begin()); ptIter != cgPoint.end (); ++ptIter) { LandXML_10::CgPoint::NameOptional& optCode(ptIter->getCode()); if (optCode.present()) cerr <<"code:" << optCode.get() << endl; cerr << *ptIter <>> error C2440: 'initializing' : cannot convert from 'LandXML_10::CgPoint' to 'xercesc_3_0::DOMElement &' Please if someone can give me some advices. Thanks Best Regards, Constantin Iacobescu