From benedikt2011a at googlemail.com Thu Aug 18 05:44:42 2011 From: benedikt2011a at googlemail.com (Benedikt P) Date: Thu Aug 18 05:47:46 2011 Subject: [xsde-users] xsde 3.2 with Xcode 4 and IOS 4.3 Message-ID: Hi *, I am trying to use xsde 3.2 with Apples IOS 4.3 and Xcode 4 and I am running into serious problems. Has anybody used this configuration successfully yet? After changing a lot of settings and trying, my project now runs in the simulator, but does not compile for the actual ipad (bad codegen, pointer diff in xsde ... global weak symbol vtable for xsde....). Any suggestions? Thank you for your help. Best regards. From boris at codesynthesis.com Fri Aug 19 04:34:45 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Aug 19 04:37:19 2011 Subject: [xsde-users] xsde 3.2 with Xcode 4 and IOS 4.3 In-Reply-To: References: Message-ID: Hi Benedikt, Benedikt P writes: > I am trying to use xsde 3.2 with Apples IOS 4.3 and Xcode 4 and I am running > into serious problems. Has anybody used this configuration successfully yet? Yes, I believe James Sutton (CC'ed) is using XSD/e with XCode 4 using the native XCode project approach for building libxsde. > After changing a lot of settings and trying, my project now runs in the > simulator, but does not compile for the actual ipad (bad codegen, pointer > diff in xsde ... global weak symbol vtable for xsde....). If the errors look anything like this (remember to always show the exact errors messages in the future): ld: bad codegen, pointer diff in __ZN4xsde3cxx6parser10validating13integer_pskelC2Ev to global weak symbol __ZTVN4xsde3cxx6parser10validating13integer_pskelE for architecture i386 Then James mentioned the solution: > The answer is in 'Build Settings' for the libxsde project under > 'LLVM GCC 4.2 Code Generation' set 'Symbols Hidden by Default' > to 'Yes'. Let us know if it works for you. Boris From jrs at jmsutton.co.uk Fri Aug 19 05:05:30 2011 From: jrs at jmsutton.co.uk (James Sutton) Date: Fri Aug 19 05:12:53 2011 Subject: [xsde-users] xsde 3.2 with Xcode 4 and IOS 4.3 In-Reply-To: References: Message-ID: Hi Benedikt It is indeed still working for me in the simulator and in the iPad. James On 19 Aug, 2011, at 9:34, Boris Kolpackov wrote: > Hi Benedikt, > > Benedikt P writes: > >> I am trying to use xsde 3.2 with Apples IOS 4.3 and Xcode 4 and I am running >> into serious problems. Has anybody used this configuration successfully yet? > > Yes, I believe James Sutton (CC'ed) is using XSD/e with XCode 4 using > the native XCode project approach for building libxsde. > > >> After changing a lot of settings and trying, my project now runs in the >> simulator, but does not compile for the actual ipad (bad codegen, pointer >> diff in xsde ... global weak symbol vtable for xsde....). > > If the errors look anything like this (remember to always show the exact > errors messages in the future): > > ld: bad codegen, pointer diff in __ZN4xsde3cxx6parser10validating13integer_pskelC2Ev > to global weak symbol __ZTVN4xsde3cxx6parser10validating13integer_pskelE for architecture i386 > > Then James mentioned the solution: > >> The answer is in 'Build Settings' for the libxsde project under >> 'LLVM GCC 4.2 Code Generation' set 'Symbols Hidden by Default' >> to 'Yes'. > > Let us know if it works for you. > > Boris From benedikt2011a at googlemail.com Mon Aug 22 08:02:29 2011 From: benedikt2011a at googlemail.com (Benedikt P) Date: Mon Aug 22 11:15:23 2011 Subject: [xsde-users] xsde 3.2 with Xcode 4 and IOS 4.3 In-Reply-To: References: Message-ID: Hello Guys, thank you for your help - i am now one step further. My application does compile for the device and in the simulator with the mentioned setting (hidden symbol visibility). But the application itself does not run correctly xsde::cxx::serializer::validating::string_simpl::~string_simpl() throws exec_bad_access error. My Xcode thinks this error might appear in string-stl.hxx, which seems strange, as i did not manually modify it. Thank you for your help! Best regards, Benedikt 2011/8/19 James Sutton > Hi Benedikt > It is indeed still working for me in the simulator and in the iPad. > James > > On 19 Aug, 2011, at 9:34, Boris Kolpackov wrote: > > > Hi Benedikt, > > > > Benedikt P writes: > > > >> I am trying to use xsde 3.2 with Apples IOS 4.3 and Xcode 4 and I am > running > >> into serious problems. Has anybody used this configuration successfully > yet? > > > > Yes, I believe James Sutton (CC'ed) is using XSD/e with XCode 4 using > > the native XCode project approach for building libxsde. > > > > > >> After changing a lot of settings and trying, my project now runs in the > >> simulator, but does not compile for the actual ipad (bad codegen, > pointer > >> diff in xsde ... global weak symbol vtable for xsde....). > > > > If the errors look anything like this (remember to always show the exact > > errors messages in the future): > > > > ld: bad codegen, pointer diff in > __ZN4xsde3cxx6parser10validating13integer_pskelC2Ev > > to global weak symbol __ZTVN4xsde3cxx6parser10validating13integer_pskelE > for architecture i386 > > > > Then James mentioned the solution: > > > >> The answer is in 'Build Settings' for the libxsde project under > >> 'LLVM GCC 4.2 Code Generation' set 'Symbols Hidden by Default' > >> to 'Yes'. > > > > Let us know if it works for you. > > > > Boris > > From arn at bestmx.ru Mon Aug 22 08:36:43 2011 From: arn at bestmx.ru (Anton Yabchinskiy) Date: Mon Aug 22 11:15:23 2011 Subject: [xsde-users] Name conflict in generated serializer code Message-ID: Hello. I am using XSDe to generate bindings for PSIA XML schemas (http://www.psialliance.org). There is a complex type "ResourceDescription" in Service.xsd (file is not so big, so it's attached). It has among others "post" and "delete" elements. While "delete" is handled properly by appending underscore to it, "post" interferes with the virtual post() method defined in xsde::cxx::serializer::serializer_base, with compiler complaining like this: error: conflicting return type specified for 'virtual const psialliance_org::URLParameters& psialliance_org::ResourceDescription_sskel::post()' /tmp/xsde-3.2.0-i686-linux-gnu/libxsde/xsde/cxx/serializer/elements.hxx:64: error: overriding 'virtual void xsde::cxx::serializer::serializer_base::post()' Seems like I have to post process the generated files (or pre process the schema) with some kind of sed. Or maybe it is possible to add keywords to keyword set of xsde tool? If there is no such possibility, maybe a command line option for such thing should be added to xsde tool? -------------- next part -------------- A non-text attachment was scrubbed... Name: Service.xsd Type: application/xml Size: 5977 bytes Desc: Service.xsd Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20110822/b2e6244e/Service.xml From boris at codesynthesis.com Mon Aug 22 11:24:37 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Aug 22 11:27:10 2011 Subject: [xsde-users] xsde 3.2 with Xcode 4 and IOS 4.3 In-Reply-To: References: Message-ID: Hi Benedikt, Benedikt P writes: > But the application itself does not run correctly Both on the simulator and the device or only on the device? > xsde::cxx::serializer::validating::string_simpl::~string_simpl() throws > exec_bad_access error. My Xcode thinks this error might appear in > string-stl.hxx, which seems strange, as i did not manually modify it. This is either a problem in your code (most likely) on the XSD/e code (less likely, but also possible). To find out which one it is, I suggest that you replace your parsing/serialization code with the known-to-work code from one of the examples (e.g., from cxx/hybrid/library) and see if you still get this signal. If you don't, then the problem is most likely in the way you setup your parsing/serialization. One likely case would be calling the serializer and passing an object model that has already been deleted. Boris From boris at codesynthesis.com Mon Aug 22 11:29:34 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Aug 22 11:32:06 2011 Subject: [xsde-users] Name conflict in generated serializer code In-Reply-To: References: Message-ID: Hi Anton, Anton Yabchinskiy writes: > There is a complex type "ResourceDescription" in Service.xsd. It has > among others "post" and "delete" elements. > > [...] > > error: conflicting return type specified for 'virtual const > psialliance_org::URLParameters& > psialliance_org::ResourceDescription_sskel::post()' > > Or maybe it is possible to add keywords to keyword set of xsde tool? Yes, it is. The --reserved-name option should do the trick here: --reserved-name post Or: --reserved-name post=my_post Boris From rashij at cybage.com Wed Aug 17 10:15:48 2011 From: rashij at cybage.com (Rashi Jha) Date: Mon Aug 22 12:12:55 2011 Subject: "updated" [xsde-users] error "unable to open in read mode" Message-ID: Hi Boris, I am now using cxx-parser for generating the classes. I am trying to parse the sample xml: Good Health Clinic Continuity of Care Document I used the following command to generate the classes: # xsde cxx-parser --generate-polymorphic --hxx-suffix .h --cxx-suffix .cpp SampleXsd.xsd And in the corresponding driver code I created the structures for the complex types which inherit the parser skeleton files. In main I tried calling title() function and post_ST(), but none of them could read the contents of I am not able to figure out which method I need to overload in order to access the contents of <title> element. Please find the generated classes , sample XSD and driver code for the sample problem. Query regarding Android platform: I wanted to know that other than building a separate library for android, will the driver code that i will write for the classes generated for iOS applications would work the same in android or do I need to write a separate driver code for android applications? Looking forward to your reply. Rashi -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Monday, August 08, 2011 5:42 PM To: Rashi Jha Cc: Amit Jain; Amit Bhatnagar; Sagar Vairagar Subject: Re: [xsde-users] error "unable to open in read mode" Rashi Jha <rashij@cybage.com> writes: > In .xsd title element is of ST complex type or non-built-in XML type. The ST type has mixed content which means it can contain anything. To access the data stored in this type you will need to customize the generated object model class corresponding to this type (e.g., by adding a string member that will store the data) and provide a custom parser for it. The 'wildcard' and 'custom/wildcard' examples in the examples/cxx/hybrid directory in XSD/e show two approaches that can be used to achieve this. Boris "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com -------------- next part -------------- struct ClinicalDocument_pimpl: POCD_MT000040_ClinicalDocument_pskel { ClinicalDocument_pimpl () : POCD_MT000040_ClinicalDocument_pskel (&base_impl_, 0) { } virtual void title() { } private: POCD_MT000040_ClinicalDocument_pskel base_impl_; }; struct ST_pimpl: ST_pskel { ST_pimpl () : ST_pskel (&base_impl_, 0) { } private: ST_pskel base_impl_; }; int main (int argc, char* argv[]) { const char* input; try { xml_schema::string_pimpl string_p; ClinicalDocument_pimpl cl_p; ST_pimpl st_p; xml_schema::document_pimpl doc_p(cl_p,"ClinicalDocument"); cl_p.pre (); argc = 2; string test = "/Users/rashij/Rashi_CxxParser/OnlyST/STOnly/samplexml.xml"; if (argc < 2) doc_p.parse (cin); else doc_p.parse (test); POCD_MT000040_ClinicalDocument_pskel p_skel; //cl_p.title(); st_p.post_ST(); } catch (const xml_schema::parser_exception& e) { cerr << input << ":" << e.line () << ":" << e.column () << ": " << e.text () << endl; return 1; } catch (const std::ios_base::failure&) { cerr << input << ": unable to open or read failure" << endl; return 1; } return 0; } -------------- next part -------------- // Copyright (c) 2005-2011 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD/e, an XML Schema // to C++ data binding compiler for embedded systems. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // // Begin prologue. // // // End prologue. #include "SampleXsd-pskel.h" // ST_pskel // ST_pskel:: ST_pskel () : ST_impl_ (0) { } ST_pskel:: ST_pskel (ST_pskel* impl, void*) : ::xsde::cxx::parser::validating::complex_content (impl, 0), ST_impl_ (impl) { } // POCD_MT000040_ClinicalDocument_pskel // void POCD_MT000040_ClinicalDocument_pskel:: title_parser (::ST_pskel& p) { this->title_parser_ = &p; } void POCD_MT000040_ClinicalDocument_pskel:: title_parser (::xml_schema::parser_map& m) { this->title_parser_map_ = &m; } void POCD_MT000040_ClinicalDocument_pskel:: parsers (::ST_pskel& title) { this->title_parser_ = &title; } void POCD_MT000040_ClinicalDocument_pskel:: parser_maps (::xml_schema::parser_map& title) { this->title_parser_map_ = &title; } POCD_MT000040_ClinicalDocument_pskel:: POCD_MT000040_ClinicalDocument_pskel () : POCD_MT000040_ClinicalDocument_impl_ (0), title_parser_ (0), title_parser_map_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } POCD_MT000040_ClinicalDocument_pskel:: POCD_MT000040_ClinicalDocument_pskel (POCD_MT000040_ClinicalDocument_pskel* impl, void*) : ::xsde::cxx::parser::validating::complex_content (impl, 0), POCD_MT000040_ClinicalDocument_impl_ (impl), title_parser_ (0), title_parser_map_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } #include <assert.h> #include <string.h> #include <xsde/cxx/parser/substitution-map.hxx> #include <xsde/cxx/parser/validating/inheritance-map.hxx> static const ::xsde::cxx::parser::substitution_map_init _xsde_substitution_map_init_; static const ::xsde::cxx::parser::validating::inheritance_map_init _xsde_inheritance_map_init_; // ST_pskel // void ST_pskel:: post_ST () { if (this->ST_impl_) this->ST_impl_->post_ST (); } const char* ST_pskel:: _static_type () { return "ST"; } const char* ST_pskel:: _dynamic_type () const { return _static_type (); } // POCD_MT000040_ClinicalDocument_pskel // void POCD_MT000040_ClinicalDocument_pskel:: title () { if (this->POCD_MT000040_ClinicalDocument_impl_) this->POCD_MT000040_ClinicalDocument_impl_->title (); } void POCD_MT000040_ClinicalDocument_pskel:: post_POCD_MT000040_ClinicalDocument () { if (this->POCD_MT000040_ClinicalDocument_impl_) this->POCD_MT000040_ClinicalDocument_impl_->post_POCD_MT000040_ClinicalDocument (); } void POCD_MT000040_ClinicalDocument_pskel:: _reset () { if (this->resetting_) return; typedef ::xsde::cxx::parser::validating::complex_content base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->title_parser_) this->title_parser_->_reset (); if (this->title_parser_map_) this->title_parser_map_->reset (); this->resetting_ = false; } const char* POCD_MT000040_ClinicalDocument_pskel:: _static_type () { return "POCD_MT000040.ClinicalDocument"; } const char* POCD_MT000040_ClinicalDocument_pskel:: _dynamic_type () const { return _static_type (); } #include <assert.h> // Element validation and dispatch functions for POCD_MT000040_ClinicalDocument_pskel. // bool POCD_MT000040_ClinicalDocument_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, const char* t) { XSDE_UNUSED (t); ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::xsde::cxx::parser::validating::complex_content base; if (base::_start_element_impl (ns, n, t)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, t, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "title" && ns.empty ()) s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &POCD_MT000040_ClinicalDocument_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, t, true); } else { return false; } } else return false; } return true; } bool POCD_MT000040_ClinicalDocument_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::xsde::cxx::parser::validating::complex_content base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, 0, false); if (vd.state == ~0UL) vs.size--; return true; } void POCD_MT000040_ClinicalDocument_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; } void POCD_MT000040_ClinicalDocument_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, 0, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } this->v_state_stack_.pop (); } void POCD_MT000040_ClinicalDocument_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, const char* t, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (t); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "title" && ns.empty ()) { if (start) { ::ST_pskel* p = 0; if (t == 0 && this->title_parser_ != 0) p = this->title_parser_; else { const char* ts = ::ST_pskel::_static_type (); if (t == 0) t = ts; if (this->title_parser_ != 0 && strcmp (t, ts) == 0) p = this->title_parser_; else { if (t != ts && !::xsde::cxx::parser::validating::inheritance_map_instance ().check (t, ts)) { ctx.schema_error (::xsde::cxx::schema_error::not_derived); return; } if (this->title_parser_map_ != 0) p = static_cast< ::ST_pskel* > ( this->title_parser_map_->find (t)); } } if (p) { p->pre (); ctx.nested_parser (p); } } else { ::ST_pskel* p = static_cast< ::ST_pskel* > (ctx.nested_parser ()); if (p != 0) { p->post_ST (); this->title (); } count = 0; state = ~0UL; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Character validation functions for ST_pskel. // bool ST_pskel:: _characters_impl (const ::xsde::cxx::ro_string& s) { this->_any_characters (s); return true; } // Begin epilogue. // // // End epilogue. -------------- next part -------------- // Copyright (c) 2005-2011 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD/e, an XML Schema // to C++ data binding compiler for embedded systems. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // #ifndef SAMPLE_XSD_PSKEL_H #define SAMPLE_XSD_PSKEL_H #include <xsde/cxx/version.hxx> #if (XSDE_INT_VERSION != 3020000L) #error XSD/e runtime version mismatch #endif #include <xsde/cxx/config.hxx> #ifndef XSDE_ENCODING_UTF8 #error the generated code uses the UTF-8 encodingwhile the XSD/e runtime does not (reconfigure the runtime or change the --char-encoding value) #endif #ifndef XSDE_STL #error the generated code uses STL while the XSD/e runtime does not (reconfigure the runtime or add --no-stl) #endif #ifndef XSDE_IOSTREAM #error the generated code uses iostream while the XSD/e runtime does not (reconfigure the runtime or add --no-iostream) #endif #ifndef XSDE_EXCEPTIONS #error the generated code uses exceptions while the XSD/e runtime does not (reconfigure the runtime or add --no-exceptions) #endif #ifndef XSDE_LONGLONG #error the generated code uses long long while the XSD/e runtime does not (reconfigure the runtime or add --no-long-long) #endif #ifndef XSDE_PARSER_VALIDATION #error the generated code uses validation while the XSD/e runtime does not (reconfigure the runtime or add --suppress-validation) #endif #ifndef XSDE_POLYMORPHIC #error the generated code expects XSD/e runtime with polymorphism support (reconfigure the runtime or remove --generate-polymorphic/--runtime-polymorphic) #endif #ifndef XSDE_REUSE_STYLE_TIEIN #error the generated code uses the tiein reuse style while the XSD/e runtime does not (reconfigure the runtime or add --reuse-style-mixin or --reuse-style-none) #endif #ifdef XSDE_CUSTOM_ALLOCATOR #error the XSD/e runtime uses custom allocator while the generated code does not (reconfigure the runtime or add --custom-allocator) #endif #include <xsde/cxx/pre.hxx> // Begin prologue. // // // End prologue. // Forward declarations // class ST_pskel; class POCD_MT000040_ClinicalDocument_pskel; #include <xsde/cxx/ro-string.hxx> #include <xsde/cxx/parser/xml-schema.hxx> #include <xsde/cxx/parser/exceptions.hxx> #include <xsde/cxx/parser/map.hxx> #include <xsde/cxx/parser/substitution-map-callback.hxx> #include <xsde/cxx/parser/substitution-map-load.hxx> #include <xsde/cxx/parser/validating/inheritance-map-load.hxx> #include <xsde/cxx/stack.hxx> #include <xsde/cxx/parser/validating/parser.hxx> #include <xsde/cxx/parser/validating/xml-schema-pskel.hxx> #include <xsde/cxx/parser/validating/xml-schema-pimpl.hxx> #include <xsde/cxx/parser/expat/document.hxx> namespace xml_schema { // Built-in XML Schema types mapping. // using ::xsde::cxx::string_sequence; using ::xsde::cxx::qname; using ::xsde::cxx::buffer; using ::xsde::cxx::time_zone; using ::xsde::cxx::gday; using ::xsde::cxx::gmonth; using ::xsde::cxx::gyear; using ::xsde::cxx::gmonth_day; using ::xsde::cxx::gyear_month; using ::xsde::cxx::date; using ::xsde::cxx::time; using ::xsde::cxx::date_time; using ::xsde::cxx::duration; // Base parser skeletons. // using ::xsde::cxx::parser::parser_base; typedef ::xsde::cxx::parser::validating::empty_content parser_empty_content; typedef ::xsde::cxx::parser::validating::simple_content parser_simple_content; typedef ::xsde::cxx::parser::validating::complex_content parser_complex_content; typedef ::xsde::cxx::parser::validating::list_base parser_list_base; // Parser map interface and default implementation. // using ::xsde::cxx::parser::parser_map; using ::xsde::cxx::parser::parser_map_impl; // Parser substitution map callack. // using ::xsde::cxx::parser::parser_smap_callback; // Substitution and inheritance hashmaps load querying. // using ::xsde::cxx::parser::parser_smap_buckets; using ::xsde::cxx::parser::parser_smap_elements; using ::xsde::cxx::parser::validating::parser_imap_buckets; using ::xsde::cxx::parser::validating::parser_imap_elements; // Parser skeletons and implementations for the XML Schema // built-in types. // using ::xsde::cxx::parser::validating::any_type_pskel; using ::xsde::cxx::parser::validating::any_type_pimpl; using ::xsde::cxx::parser::validating::any_simple_type_pskel; using ::xsde::cxx::parser::validating::any_simple_type_pimpl; using ::xsde::cxx::parser::validating::byte_pskel; using ::xsde::cxx::parser::validating::byte_pimpl; using ::xsde::cxx::parser::validating::unsigned_byte_pskel; using ::xsde::cxx::parser::validating::unsigned_byte_pimpl; using ::xsde::cxx::parser::validating::short_pskel; using ::xsde::cxx::parser::validating::short_pimpl; using ::xsde::cxx::parser::validating::unsigned_short_pskel; using ::xsde::cxx::parser::validating::unsigned_short_pimpl; using ::xsde::cxx::parser::validating::int_pskel; using ::xsde::cxx::parser::validating::int_pimpl; using ::xsde::cxx::parser::validating::unsigned_int_pskel; using ::xsde::cxx::parser::validating::unsigned_int_pimpl; using ::xsde::cxx::parser::validating::long_pskel; using ::xsde::cxx::parser::validating::long_pimpl; using ::xsde::cxx::parser::validating::unsigned_long_pskel; using ::xsde::cxx::parser::validating::unsigned_long_pimpl; using ::xsde::cxx::parser::validating::integer_pskel; using ::xsde::cxx::parser::validating::integer_pimpl; using ::xsde::cxx::parser::validating::non_positive_integer_pskel; using ::xsde::cxx::parser::validating::non_positive_integer_pimpl; using ::xsde::cxx::parser::validating::non_negative_integer_pskel; using ::xsde::cxx::parser::validating::non_negative_integer_pimpl; using ::xsde::cxx::parser::validating::positive_integer_pskel; using ::xsde::cxx::parser::validating::positive_integer_pimpl; using ::xsde::cxx::parser::validating::negative_integer_pskel; using ::xsde::cxx::parser::validating::negative_integer_pimpl; using ::xsde::cxx::parser::validating::boolean_pskel; using ::xsde::cxx::parser::validating::boolean_pimpl; using ::xsde::cxx::parser::validating::float_pskel; using ::xsde::cxx::parser::validating::float_pimpl; using ::xsde::cxx::parser::validating::double_pskel; using ::xsde::cxx::parser::validating::double_pimpl; using ::xsde::cxx::parser::validating::decimal_pskel; using ::xsde::cxx::parser::validating::decimal_pimpl; using ::xsde::cxx::parser::validating::string_pskel; using ::xsde::cxx::parser::validating::string_pimpl; using ::xsde::cxx::parser::validating::normalized_string_pskel; using ::xsde::cxx::parser::validating::normalized_string_pimpl; using ::xsde::cxx::parser::validating::token_pskel; using ::xsde::cxx::parser::validating::token_pimpl; using ::xsde::cxx::parser::validating::name_pskel; using ::xsde::cxx::parser::validating::name_pimpl; using ::xsde::cxx::parser::validating::nmtoken_pskel; using ::xsde::cxx::parser::validating::nmtoken_pimpl; using ::xsde::cxx::parser::validating::nmtokens_pskel; using ::xsde::cxx::parser::validating::nmtokens_pimpl; using ::xsde::cxx::parser::validating::ncname_pskel; using ::xsde::cxx::parser::validating::ncname_pimpl; using ::xsde::cxx::parser::validating::language_pskel; using ::xsde::cxx::parser::validating::language_pimpl; using ::xsde::cxx::parser::validating::id_pskel; using ::xsde::cxx::parser::validating::id_pimpl; using ::xsde::cxx::parser::validating::idref_pskel; using ::xsde::cxx::parser::validating::idref_pimpl; using ::xsde::cxx::parser::validating::idrefs_pskel; using ::xsde::cxx::parser::validating::idrefs_pimpl; using ::xsde::cxx::parser::validating::uri_pskel; using ::xsde::cxx::parser::validating::uri_pimpl; using ::xsde::cxx::parser::validating::qname_pskel; using ::xsde::cxx::parser::validating::qname_pimpl; using ::xsde::cxx::parser::validating::base64_binary_pskel; using ::xsde::cxx::parser::validating::base64_binary_pimpl; using ::xsde::cxx::parser::validating::hex_binary_pskel; using ::xsde::cxx::parser::validating::hex_binary_pimpl; using ::xsde::cxx::parser::validating::date_pskel; using ::xsde::cxx::parser::validating::date_pimpl; using ::xsde::cxx::parser::validating::date_time_pskel; using ::xsde::cxx::parser::validating::date_time_pimpl; using ::xsde::cxx::parser::validating::duration_pskel; using ::xsde::cxx::parser::validating::duration_pimpl; using ::xsde::cxx::parser::validating::gday_pskel; using ::xsde::cxx::parser::validating::gday_pimpl; using ::xsde::cxx::parser::validating::gmonth_pskel; using ::xsde::cxx::parser::validating::gmonth_pimpl; using ::xsde::cxx::parser::validating::gmonth_day_pskel; using ::xsde::cxx::parser::validating::gmonth_day_pimpl; using ::xsde::cxx::parser::validating::gyear_pskel; using ::xsde::cxx::parser::validating::gyear_pimpl; using ::xsde::cxx::parser::validating::gyear_month_pskel; using ::xsde::cxx::parser::validating::gyear_month_pimpl; using ::xsde::cxx::parser::validating::time_pskel; using ::xsde::cxx::parser::validating::time_pimpl; // Read-only string. // using ::xsde::cxx::ro_string; // Error codes. // typedef xsde::cxx::parser::expat::xml_error parser_xml_error; typedef xsde::cxx::schema_error parser_schema_error; // Exceptions. // typedef xsde::cxx::parser::exception parser_exception; typedef xsde::cxx::parser::xml parser_xml; typedef xsde::cxx::parser::schema parser_schema; // Document parser. // using xsde::cxx::parser::expat::document_pimpl; // Parser context. // typedef xsde::cxx::parser::context parser_context; } class ST_pskel: public ::xsde::cxx::parser::validating::complex_content { public: // Parser callbacks. Override them in your implementation. // // virtual void // pre (); virtual void post_ST (); // Constructor. // ST_pskel (); public: static const char* _static_type (); virtual const char* _dynamic_type () const; // Implementation details. // protected: ST_pskel* ST_impl_; ST_pskel (ST_pskel*, void*); protected: virtual bool _characters_impl (const ::xsde::cxx::ro_string&); }; class POCD_MT000040_ClinicalDocument_pskel: public ::xsde::cxx::parser::validating::complex_content { public: // Parser callbacks. Override them in your implementation. // // virtual void // pre (); // Elements. // virtual void title (); virtual void post_POCD_MT000040_ClinicalDocument (); // Parser construction API. // void parsers (::ST_pskel& /* title */); void parser_maps (::xml_schema::parser_map& /* title */); // Individual element parsers. // void title_parser (::ST_pskel&); void title_parser (::xml_schema::parser_map&); virtual void _reset (); // Constructor. // POCD_MT000040_ClinicalDocument_pskel (); public: static const char* _static_type (); virtual const char* _dynamic_type () const; // Implementation details. // protected: POCD_MT000040_ClinicalDocument_pskel* POCD_MT000040_ClinicalDocument_impl_; POCD_MT000040_ClinicalDocument_pskel (POCD_MT000040_ClinicalDocument_pskel*, void*); protected: virtual bool _start_element_impl (const ::xsde::cxx::ro_string&, const ::xsde::cxx::ro_string&, const char*); virtual bool _end_element_impl (const ::xsde::cxx::ro_string&, const ::xsde::cxx::ro_string&); protected: ::ST_pskel* title_parser_; ::xml_schema::parser_map* title_parser_map_; public: struct v_state_descr_ { void (::POCD_MT000040_ClinicalDocument_pskel::*func) ( unsigned long&, unsigned long&, const ::xsde::cxx::ro_string&, const ::xsde::cxx::ro_string&, const char*, bool); unsigned long state; unsigned long count; }; struct v_state_ { v_state_descr_ data[2UL]; unsigned long size; }; protected: v_state_ v_state_first_; ::xsde::cxx::stack v_state_stack_; virtual void _pre_e_validate (); virtual void _post_e_validate (); void sequence_0 (unsigned long&, unsigned long&, const ::xsde::cxx::ro_string&, const ::xsde::cxx::ro_string&, const char*, bool); }; // Begin epilogue. // // // End epilogue. #include <xsde/cxx/post.hxx> #endif // SAMPLE_XSD_PSKEL_H -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleXsd.xsd Type: text/xml Size: 404 bytes Desc: SampleXsd.xsd Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20110817/77f7527f/SampleXsd.bin From boris at codesynthesis.com Mon Aug 22 12:29:11 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Aug 22 12:31:46 2011 Subject: "updated" [xsde-users] error "unable to open in read mode" In-Reply-To: <DD4F3CE13673D54688EB7AE9AB7AD6F017C97190@ct1-mailbox-1-3.cybage.com> References: <DD4F3CE13673D54688EB7AE9AB7AD6F017C97190@ct1-mailbox-1-3.cybage.com> Message-ID: <boris.20110822181355@codesynthesis.com> Hi Rashi, Rashi Jha <rashij@cybage.com> writes: > And in the corresponding driver code I created the structures for the > complex types which inherit the parser skeleton files. I looked into your driver implementation and from the code it is clear to me that you don't have a good understanding of the C++/Parser programming model. In particular: 1. You pass a skeleton as a base implementation (base_pimpl_). 2. You haven't connection the parsers. 3. You are trying to call a callback function yourself (title()). 4. You are calling the post() function for an inner parser, not for the document root. I suggest that before you attempt to write any code, you carefully study the C++/Parser Getting Started Guide and make sure you understand the C++/Parser programming model. > In main I tried calling title() function and post_ST(), but none of > them could read the contents of <title> As I said earlier, calling these functions directly from main() doesn't make any sense whatsoever. > I am not able to figure out which method I need to overload in order > to access the contents of <title> element. The correct term is "override", not "overload". As we discusses earlier, the ST type has mixed content. The cxx/parser/mixed example in XSD/e distribution shown how you can parse mixed content data. In your case you will at least need to override the _any_character() callback. > Query regarding Android platform: > > I wanted to know that other than building a separate library for android, > will the driver code that i will write for the classes generated for iOS > applications would work the same in android or do I need to write a > separate driver code for android applications? Yes, the same code should work on both platforms provided that you use C++ features (STL, exceptions, etc) that are available on both iOS and Android. Note also, that on Android, XSD/e can only be used as part of an NDK- based application. This may have changed, but the last time I checked, one still had to implement UI in Java and, depending on your application, passing parsed XML data from the native code to Java may not be easy. Boris