From iknerf.dream at gmail.com Sun Sep 6 02:17:51 2015 From: iknerf.dream at gmail.com (Frenk Stih) Date: Sun Sep 6 02:17:58 2015 Subject: [xsde-users] Using polymorphism Message-ID: Hello xsde, I am starting using you xsde and have also check the forum, but could not found the issue to my problem. I am working on linux and using latest 3.2.0 xsde version. I have created parser with the following scheme and using xsde options: --cxx-hybrid --generate-parser --generate--aggregate --generate-polymorphic --root-element MsgHdr --polymorphic-type MsgHdr I then try to use the MsgHdr_paggr and could parse just HDR xml messages. In the paggr there is also no pre() method? Is this ok, because when I have read your online help and polymorphic example the pre() should exists. I then tried to work on pimpl only and MsgHeader_pimpl can also parse only HDR xml message, even if I set polymorphic to true and use parsers_map. Everything is fine when parsing the MsgHeader message, but when trying to parse the MsgAcknowledgement message I always get an error in the part starting : <-- Here I get error "unexpected element encountered" I can parse this message if I use MsgAcknowledgement_pimpl, so I assume the parser is ok. The example code I am working: MsgHeader_pimpl hello_p; MsgAcknowledgement_pimpl ack_p; xml_schema::parser_map_impl p_map(3); p_map.insert(hello_p); p_map.insert(ack_p); std::cout << "test parsing POCT message" << std::endl; xml_schema::document_pimpl doc_p(hello_p, "MsgHdr", true ); std::cout << "test calling pre() of XSDe parser" << std::endl; hello_p.pre (); std::cout << "test perform parse()" << std::endl; doc_p.parse (argv[1]); Did I miss something? Thanks for any advice, Frenk From iknerf.dream at gmail.com Mon Sep 7 06:13:19 2015 From: iknerf.dream at gmail.com (Frenk Stih) Date: Mon Sep 7 06:13:26 2015 Subject: [xsde-users] Re: Using polymorphism In-Reply-To: References: Message-ID: Dear Sir, The issue was solved, thanks to the documentation and available examples. Best regards, Frenk 2015-09-06 8:17 GMT+02:00 Frenk Stih : > Hello xsde, > > > I am starting using you xsde and have also check the forum, but could > not found the issue to my problem. > > I am working on linux and using latest 3.2.0 xsde version. > > I have created parser with the following scheme > > > > > > > > > > > > /> > > > > > substitutionGroup="MsgHdr" /> > > and using xsde options: > --cxx-hybrid --generate-parser --generate--aggregate > --generate-polymorphic --root-element MsgHdr --polymorphic-type MsgHdr > > I then try to use the MsgHdr_paggr and could parse just HDR xml > messages. In the paggr there is also no pre() method? Is this ok, > because when I have read your online help and polymorphic example the > pre() should exists. I then tried to work on pimpl only and > MsgHeader_pimpl can also parse only HDR xml message, even if I set > polymorphic to true and use parsers_map. > > Everything is fine when parsing the MsgHeader message, but when trying > to parse the MsgAcknowledgement message I always get an error in the > part starting : > > > > > > > > <-- Here I get error "unexpected element encountered" > > > > > > I can parse this message if I use MsgAcknowledgement_pimpl, so I > assume the parser is ok. > > The example code I am working: > > MsgHeader_pimpl hello_p; > MsgAcknowledgement_pimpl ack_p; > xml_schema::parser_map_impl p_map(3); > p_map.insert(hello_p); > p_map.insert(ack_p); > std::cout << "test parsing POCT message" << std::endl; > xml_schema::document_pimpl doc_p(hello_p, > "MsgHdr", > true ); > std::cout << "test calling pre() of XSDe parser" << std::endl; > hello_p.pre (); > std::cout << "test perform parse()" << std::endl; > doc_p.parse (argv[1]); > > Did I miss something? > > > Thanks for any advice, Frenk