From jaume.faus at vianova.no Tue Aug 4 14:08:11 2015 From: jaume.faus at vianova.no (Jaume Dominguez Faus) Date: Wed Aug 5 08:05:01 2015 Subject: [xsd-users] Is it possible to know the progress of a parsing process? Message-ID: <10f8d420de9b4a9d87d5d83d111bdd2a@VN-EXCHANGE2.VN.Local> I'm not sure if this is the right list to ask, but I bet there is someone who knows. This is doubt I have always had. Can I have xerces (or xsd or some) telling me what is the current progress status of a file load (e.g. "5%", "17%", "99%", etc)? It would be quite useful and nice specially when one loads big files. From boris at codesynthesis.com Wed Aug 5 09:03:25 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Aug 5 09:03:28 2015 Subject: [xsd-users] Is it possible to know the progress of a parsing process? In-Reply-To: <10f8d420de9b4a9d87d5d83d111bdd2a@VN-EXCHANGE2.VN.Local> References: <10f8d420de9b4a9d87d5d83d111bdd2a@VN-EXCHANGE2.VN.Local> Message-ID: Hi Jaume, Jaume Dominguez Faus writes: > Can I have xerces (or xsd or some) telling me what is the current > progress status of a file load (e.g. "5%", "17%", "99%", etc)? There is no built-in functionality like this, but it is pretty easy to implement yourself. The idea is to write your own std::istream or xercesc::InputSource implementation that keeps track of how many bytes have been read (which is a pretty close approximation to how many have been parsed). InputSource is actually easier to do. Take a look at libxsd/ xsd/cxx/xml/sax/std-input-source.hxx -- there you have everything that you will need. In fact, you can derive from its std_input_stream and override readBytes() to keep track of the count. Then derive from std_input_source and return this custom std_input_stream. Once that is done, you can simply pass this input source to the parsing function instead of std::istream, so your code will look somethig along these lines: std::ifstream ifs ("large.xml", ios::in | ios::binary | ios::ate); size_t size (ifs.tellg ()); // Total size, to calculate %. ifs.seekg (0, ios::beg); progress_input_source is (ifs, size); auto_ptr r (root (is)); Boris From laurence.davies at unsw.edu.au Wed Aug 5 19:14:44 2015 From: laurence.davies at unsw.edu.au (Laurence Davies) Date: Wed Aug 5 19:14:54 2015 Subject: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared In-Reply-To: References: , , Message-ID: Hi Boris, I haven't had any luck in resolving this issue, and manually correcting the header inclusion compilation errors is cumbersome at present. Are there any other avenues of exploration that you could suggest? Laurence Davies ____________________ Research Assistant in eGeodesy CRC-SI, UNSW Desk phone: (03) 8636 2373 Mobile: 0427 519 289 ________________________________________ From: Laurence Davies Sent: Wednesday, 29 July 2015 3:23 PM To: xsd-users@codesynthesis.com Subject: RE: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared Hi Boris, After running your latest a6 and using the generated classes I'm still getting the compiler errors sadly. This is the first. Error 1 error C2039: 'booleanOrNilReasonList' : is not a member of 'gml32' D:\git\eGeodesy\0.2.1\geodesyml\marshaller\windows\GeodesyML_VS10\include\binding\valueObjects.hxx 511 The other error hasn't popped up yet. I'll let you know if it does. Laurence Davies ____________________ Research Assistant in eGeodesy CRC-SI, UNSW Desk phone: (03) 8636 2373 Mobile: 0427 519 289 ________________________________________ From: Boris Kolpackov [boris@codesynthesis.com] Sent: Wednesday, 29 July 2015 1:12 AM To: Laurence Davies Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared Hi Laurence, Ok, I think I fixed this issue (and maybe the other one, who knows). Can you try the a6: http://codesynthesis.com/~boris/tmp/xsd/ Boris From boris at codesynthesis.com Thu Aug 6 07:46:12 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Aug 6 07:46:14 2015 Subject: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared In-Reply-To: References: Message-ID: Hi Laurence, Laurence Davies writes: > I haven't had any luck in resolving this issue, and manually > correcting the header inclusion compilation errors is cumbersome > at present. Are there any other avenues of exploration that you > could suggest? You need to send me the test case that actually works. See one of my earlier replies for what didn't work and what I need. Boris From rigoni at igi.cnr.it Thu Aug 6 11:16:20 2015 From: rigoni at igi.cnr.it (Andrea Rigoni) Date: Thu Aug 6 11:16:47 2015 Subject: [xsd-users] skeleton does not compile with expat in parser_auto_ptr Message-ID: Hello list, I'm new to xsd parser, I've tried to follow the simple tutorial in: http://www.codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#2 Anyway I found that the code was not compiling. I fix it adding this this two operators to the parser_auto_ptr class in expat/elements.hpp operator const bool () const { return parser_ != 0; } operator const XML_Parser & () const { return parser_; } Was this the right way ? Thanks, Andrea Rigoni From laurence.davies at unsw.edu.au Thu Aug 6 23:20:13 2015 From: laurence.davies at unsw.edu.au (Laurence Davies) Date: Thu Aug 6 23:20:21 2015 Subject: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared In-Reply-To: References: , Message-ID: Hi Boris, Referring to your two earlier emails, I have tested and confirmed that the same error appears in the a6 version you posted. Regarding your comment below: "Can you send me a test case that doesn't do anything fancy? Specifically, it should just run the XSD compiler and then try to compile the generated code which should lead to the errors you are observing." The example I provided does this explicitly given the instructions I provided. But to make it simpler, I've uploaded another version in which you can very simply test the problem. Sources here: https://www.dropbox.com/s/9w7nzq220qhiv0e/geodesyml_0.2_binding.tar.gz?dl=0 To see the problem explicitly, there is an option you need to consider. In the geodesyml.options file you will see the line #--root-element GeodesyML at the very top of the file. If you un-comment this line and call `make clean; make;` It will compile without problems at all. If you then comment out this line again and run `make clean; make;` it will clearly demonstrate the compilation errors I am talking about. These errors seem to be the result of asking XSD to produce parsers for all global elements, not just for geo:GeodesyML. The necessity of having all parsers is so that I can ask XSD to parse GML and GeodesyML files from other sources such as web services that are referenced by xlink:href attributes in the GML property convention. I hope this clearly demonstrates the bug in XSD that I've raised. Laurence Davies ____________________ Research Assistant in eGeodesy CRC-SI, UNSW Desk phone: (03) 8636 2373 Mobile: 0427 519 289 ________________________________________ From: Boris Kolpackov [boris@codesynthesis.com] Sent: Thursday, 6 August 2015 9:46 PM To: Laurence Davies Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared Hi Laurence, Laurence Davies writes: > I haven't had any luck in resolving this issue, and manually > correcting the header inclusion compilation errors is cumbersome > at present. Are there any other avenues of exploration that you > could suggest? You need to send me the test case that actually works. See one of my earlier replies for what didn't work and what I need. Boris From boris at codesynthesis.com Fri Aug 7 07:21:19 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Aug 7 07:21:20 2015 Subject: [xsd-users] skeleton does not compile with expat in parser_auto_ptr In-Reply-To: References: Message-ID: Hi Andrea, Andrea Rigoni writes: > Anyway I found that the code was not compiling. > I fix it adding this this two operators to the parser_auto_ptr class in > expat/elements.hpp > > operator const bool () const { return parser_ != 0; } > operator const XML_Parser & () const { return parser_; } > > Was this the right way ? No, the right way is to show exactly what you have tried (i.e., command lines) and what error messages you got. Boris From rigoni at igi.cnr.it Fri Aug 7 07:48:30 2015 From: rigoni at igi.cnr.it (Andrea Rigoni) Date: Fri Aug 7 07:48:58 2015 Subject: [xsd-users] skeleton does not compile with expat in parser_auto_ptr In-Reply-To: References: Message-ID: Hi Boris, you are right, sorry .. As I wrote I'm new to this tool but let me tell you that I think it's amazing ! With the code I reported I've fixed my issue so I was wondering if it could be usefull as a feedback. Please find attached the simple test I took from the tutorial and the errors of the compiler.. To build the source I was using the following tools from Arch linux: - xsd CodeSynthesis XSD XML Schema to C++ compiler 4.0.0 - gcc version 5.1.0 (GCC) - expat version 2.1.0-4 Thanks, Andrea 2015-08-07 13:21 GMT+02:00 Boris Kolpackov : > Hi Andrea, > > Andrea Rigoni writes: > > > Anyway I found that the code was not compiling. > > I fix it adding this this two operators to the parser_auto_ptr class in > > expat/elements.hpp > > > > operator const bool () const { return parser_ != 0; } > > operator const XML_Parser & () const { return parser_; } > > > > Was this the right way ? > > No, the right way is to show exactly what you have tried (i.e., > command lines) and what error messages you got. > > Boris > -------------- next part -------------- /usr/local/bin/xsd cxx-parser --xml-parser expat hello.xsd g++ -I/usr/local/include/libxsd main.cpp hello-pskel.cxx -lexpat -std=c++11 -o driver In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from main.cpp:4: /usr/local/include/xsd/cxx/parser/expat/elements.txx: In member function ?bool xsd::cxx::parser::expat::document::parse(std::istream&, const std::basic_string<_CharT>*, const std::basic_string<_CharT>*, xsd::cxx::xml::error_handler&)?: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:22: error: no match for ?operator==? (operand types are ?xsd::cxx::parser::expat::parser_auto_ptr? and ?int?) if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:569:0, from hello-pskel.hxx:65, from main.cpp:4: /usr/local/include/xsd/cxx/parser/xml-schema.txx:15:7: note: candidate: template bool xsd::cxx::parser::operator==(const xsd::cxx::parser::string_sequence&, const xsd::cxx::parser::string_sequence&) operator== (const string_sequence& a, const string_sequence& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.txx:15:7: note: template argument deduction/substitution failed: In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from main.cpp:4: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:25: note: ?xsd::cxx::parser::expat::parser_auto_ptr? is not derived from ?const xsd::cxx::parser::string_sequence? if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:568:0, from hello-pskel.hxx:65, from main.cpp:4: /usr/local/include/xsd/cxx/parser/xml-schema.ixx:113:7: note: candidate: template bool xsd::cxx::parser::operator==(const xsd::cxx::parser::qname&, const xsd::cxx::parser::qname&) operator== (const qname& a, const qname& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:113:7: note: template argument deduction/substitution failed: In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from main.cpp:4: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:25: note: ?xsd::cxx::parser::expat::parser_auto_ptr? is not derived from ?const xsd::cxx::parser::qname? if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:568:0, from hello-pskel.hxx:65, from main.cpp:4: /usr/local/include/xsd/cxx/parser/xml-schema.ixx:338:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::buffer&, const xsd::cxx::parser::buffer&) operator== (const buffer& a, const buffer& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:338:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::buffer&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:403:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::time_zone&, const xsd::cxx::parser::time_zone&) operator== (const time_zone& x, const time_zone& y) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:403:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::time_zone&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:445:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gday&, const xsd::cxx::parser::gday&) operator== (const gday& a, const gday& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:445:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gday&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:486:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gmonth&, const xsd::cxx::parser::gmonth&) operator== (const gmonth& a, const gmonth& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:486:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gmonth&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:527:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gyear&, const xsd::cxx::parser::gyear&) operator== (const gyear& a, const gyear& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:527:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gyear&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:582:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gmonth_day&, const xsd::cxx::parser::gmonth_day&) operator== (const gmonth_day& a, const gmonth_day& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:582:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gmonth_day&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:638:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gyear_month&, const xsd::cxx::parser::gyear_month&) operator== (const gyear_month& a, const gyear_month& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:638:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gyear_month&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:706:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::date&, const xsd::cxx::parser::date&) operator== (const date& a, const date& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:706:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::date&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:776:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::time&, const xsd::cxx::parser::time&) operator== (const time& a, const time& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:776:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::time&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:886:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::date_time&, const xsd::cxx::parser::date_time&) operator== (const date_time& a, const date_time& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:886:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::date_time&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:1003:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::duration&, const xsd::cxx::parser::duration&) operator== (const duration& a, const duration& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:1003:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::duration&? In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from main.cpp:4: /usr/local/include/xsd/cxx/parser/expat/elements.txx:314:55: error: cannot convert ?xsd::cxx::parser::expat::parser_auto_ptr? to ?XML_Parser {aka XML_ParserStruct*}? for argument ?1? to ?XML_Status XML_Parse(XML_Parser, const char*, int, int)? parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR) ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx: In instantiation of ?bool xsd::cxx::parser::expat::document::parse(std::istream&, const std::basic_string<_CharT>*, const std::basic_string<_CharT>*, xsd::cxx::xml::error_handler&) [with C = char; std::istream = std::basic_istream]?: /usr/local/include/xsd/cxx/parser/expat/elements.txx:133:17: required from ?void xsd::cxx::parser::expat::document::parse(std::istream&, const std::basic_string<_CharT>&) [with C = char; std::istream = std::basic_istream]? /usr/local/include/xsd/cxx/parser/expat/elements.txx:95:17: required from ?void xsd::cxx::parser::expat::document::parse(const std::basic_string<_CharT>&) [with C = char]? main.cpp:47:25: required from here /usr/local/include/xsd/cxx/parser/expat/elements.txx:286:25: error: no matching function for call to ?xsd::cxx::parser::expat::document::parse_begin(xsd::cxx::parser::expat::parser_auto_ptr&, const std::basic_string&, xsd::cxx::xml::error_handler&)? parse_begin (parser, system_id ? *system_id : *public_id, eh); ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:362:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:362:14: note: candidate expects 1 argument, 3 provided /usr/local/include/xsd/cxx/parser/expat/elements.txx:372:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, const std::basic_string<_CharT>&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:372:14: note: candidate expects 2 arguments, 3 provided /usr/local/include/xsd/cxx/parser/expat/elements.txx:383:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, xsd::cxx::xml::error_handler&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:383:14: note: candidate expects 2 arguments, 3 provided /usr/local/include/xsd/cxx/parser/expat/elements.txx:393:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, const std::basic_string<_CharT>&, xsd::cxx::xml::error_handler&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:393:14: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?XML_Parser {aka XML_ParserStruct*}? /usr/local/include/xsd/cxx/parser/expat/elements.txx:288:25: error: no matching function for call to ?xsd::cxx::parser::expat::document::parse_begin(xsd::cxx::parser::expat::parser_auto_ptr&, xsd::cxx::xml::error_handler&)? parse_begin (parser, eh); ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:362:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:362:14: note: candidate expects 1 argument, 2 provided /usr/local/include/xsd/cxx/parser/expat/elements.txx:372:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, const std::basic_string<_CharT>&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:372:14: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?XML_Parser {aka XML_ParserStruct*}? /usr/local/include/xsd/cxx/parser/expat/elements.txx:383:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, xsd::cxx::xml::error_handler&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:383:14: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?XML_Parser {aka XML_ParserStruct*}? /usr/local/include/xsd/cxx/parser/expat/elements.txx:393:14: note: candidate: void xsd::cxx::parser::expat::document::parse_begin(XML_Parser, const std::basic_string<_CharT>&, xsd::cxx::xml::error_handler&) [with C = char; XML_Parser = XML_ParserStruct*] void document:: ^ /usr/local/include/xsd/cxx/parser/expat/elements.txx:393:14: note: candidate expects 3 arguments, 2 provided In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/expat/elements.txx: In member function ?bool xsd::cxx::parser::expat::document::parse(std::istream&, const std::basic_string<_CharT>*, const std::basic_string<_CharT>*, xsd::cxx::xml::error_handler&)?: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:22: error: no match for ?operator==? (operand types are ?xsd::cxx::parser::expat::parser_auto_ptr? and ?int?) if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:569:0, from hello-pskel.hxx:65, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/xml-schema.txx:15:7: note: candidate: template bool xsd::cxx::parser::operator==(const xsd::cxx::parser::string_sequence&, const xsd::cxx::parser::string_sequence&) operator== (const string_sequence& a, const string_sequence& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.txx:15:7: note: template argument deduction/substitution failed: In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:25: note: ?xsd::cxx::parser::expat::parser_auto_ptr? is not derived from ?const xsd::cxx::parser::string_sequence? if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:568:0, from hello-pskel.hxx:65, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/xml-schema.ixx:113:7: note: candidate: template bool xsd::cxx::parser::operator==(const xsd::cxx::parser::qname&, const xsd::cxx::parser::qname&) operator== (const qname& a, const qname& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:113:7: note: template argument deduction/substitution failed: In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/expat/elements.txx:282:25: note: ?xsd::cxx::parser::expat::parser_auto_ptr? is not derived from ?const xsd::cxx::parser::qname? if (parser == 0) ^ In file included from /usr/local/include/xsd/cxx/parser/xml-schema.hxx:568:0, from hello-pskel.hxx:65, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/xml-schema.ixx:338:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::buffer&, const xsd::cxx::parser::buffer&) operator== (const buffer& a, const buffer& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:338:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::buffer&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:403:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::time_zone&, const xsd::cxx::parser::time_zone&) operator== (const time_zone& x, const time_zone& y) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:403:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::time_zone&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:445:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gday&, const xsd::cxx::parser::gday&) operator== (const gday& a, const gday& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:445:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gday&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:486:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gmonth&, const xsd::cxx::parser::gmonth&) operator== (const gmonth& a, const gmonth& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:486:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gmonth&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:527:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gyear&, const xsd::cxx::parser::gyear&) operator== (const gyear& a, const gyear& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:527:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gyear&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:582:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gmonth_day&, const xsd::cxx::parser::gmonth_day&) operator== (const gmonth_day& a, const gmonth_day& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:582:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gmonth_day&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:638:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::gyear_month&, const xsd::cxx::parser::gyear_month&) operator== (const gyear_month& a, const gyear_month& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:638:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::gyear_month&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:706:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::date&, const xsd::cxx::parser::date&) operator== (const date& a, const date& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:706:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::date&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:776:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::time&, const xsd::cxx::parser::time&) operator== (const time& a, const time& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:776:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::time&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:886:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::date_time&, const xsd::cxx::parser::date_time&) operator== (const date_time& a, const date_time& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:886:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::date_time&? /usr/local/include/xsd/cxx/parser/xml-schema.ixx:1003:7: note: candidate: bool xsd::cxx::parser::operator==(const xsd::cxx::parser::duration&, const xsd::cxx::parser::duration&) operator== (const duration& a, const duration& b) ^ /usr/local/include/xsd/cxx/parser/xml-schema.ixx:1003:7: note: no known conversion for argument 1 from ?xsd::cxx::parser::expat::parser_auto_ptr? to ?const xsd::cxx::parser::duration&? In file included from /usr/local/include/xsd/cxx/parser/expat/elements.hxx:363:0, from hello-pskel.hxx:70, from hello-pskel.cxx:41: /usr/local/include/xsd/cxx/parser/expat/elements.txx:314:55: error: cannot convert ?xsd::cxx::parser::expat::parser_auto_ptr? to ?XML_Parser {aka XML_ParserStruct*}? for argument ?1? to ?XML_Status XML_Parse(XML_Parser, const char*, int, int)? parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR) ^ Makefile:7: recipe for target 'all' failed make: *** [all] Error 1 -------------- next part -------------- A non-text attachment was scrubbed... Name: expat_test.tar.gz Type: application/x-gzip Size: 963 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150807/a65e3dd1/expat_test.tar-0001.bin From boris at codesynthesis.com Tue Aug 11 11:54:44 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Aug 11 11:54:48 2015 Subject: [xsd-users] skeleton does not compile with expat in parser_auto_ptr In-Reply-To: References: Message-ID: Hi Andrea, Andrea Rigoni writes: > As I wrote I'm new to this tool but let me tell you that I think it's > amazing ! Thanks, I am glad you like it. > With the code I reported I've fixed my issue so I was wondering if it > could be usefull as a feedback. Thanks for the test case. This bug has already been fixed for the next release. The fix is a bit different to yours, though: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=94cba986108a0e0f42295572ca42c356d59328d7 Boris From laurence.davies at unsw.edu.au Thu Aug 13 01:59:25 2015 From: laurence.davies at unsw.edu.au (Laurence Davies) Date: Thu Aug 13 02:02:25 2015 Subject: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared In-Reply-To: References: , , Message-ID: Hi Boris, To follow this up, I've found a work-around in my specific application. Using a subset of the GML schema which covers the types required for my app schema, the resultant generated code compiles even with all root element parsers generated by XSD. If you'd like to see the subset GML schema that I used just let me know and I can send it to you. Unfortunately, using a subset of GML means that my code can't be used as a parser for all GML elements. Laurence Davies ____________________ Research Assistant in eGeodesy CRC-SI, UNSW Desk phone: (03) 8636 2373 Mobile: 0427 519 289 ________________________________________ From: Laurence Davies Sent: Friday, 7 August 2015 1:20 PM To: xsd-users@codesynthesis.com Subject: RE: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared Hi Boris, Referring to your two earlier emails, I have tested and confirmed that the same error appears in the a6 version you posted. Regarding your comment below: "Can you send me a test case that doesn't do anything fancy? Specifically, it should just run the XSD compiler and then try to compile the generated code which should lead to the errors you are observing." The example I provided does this explicitly given the instructions I provided. But to make it simpler, I've uploaded another version in which you can very simply test the problem. Sources here: https://www.dropbox.com/s/9w7nzq220qhiv0e/geodesyml_0.2_binding.tar.gz?dl=0 To see the problem explicitly, there is an option you need to consider. In the geodesyml.options file you will see the line #--root-element GeodesyML at the very top of the file. If you un-comment this line and call `make clean; make;` It will compile without problems at all. If you then comment out this line again and run `make clean; make;` it will clearly demonstrate the compilation errors I am talking about. These errors seem to be the result of asking XSD to produce parsers for all global elements, not just for geo:GeodesyML. The necessity of having all parsers is so that I can ask XSD to parse GML and GeodesyML files from other sources such as web services that are referenced by xlink:href attributes in the GML property convention. I hope this clearly demonstrates the bug in XSD that I've raised. Laurence Davies ____________________ Research Assistant in eGeodesy CRC-SI, UNSW Desk phone: (03) 8636 2373 Mobile: 0427 519 289 ________________________________________ From: Boris Kolpackov [boris@codesynthesis.com] Sent: Thursday, 6 August 2015 9:46 PM To: Laurence Davies Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared Hi Laurence, Laurence Davies writes: > I haven't had any luck in resolving this issue, and manually > correcting the header inclusion compilation errors is cumbersome > at present. Are there any other avenues of exploration that you > could suggest? You need to send me the test case that actually works. See one of my earlier replies for what didn't work and what I need. Boris From roehser at surgitaix.com Wed Aug 12 08:02:06 2015 From: roehser at surgitaix.com (=?iso-8859-1?Q?Matthias_R=F6hser?=) Date: Thu Aug 13 10:48:16 2015 Subject: [xsd-users] Malformed document Message-ID: <006a01d0d4f6$b5b3d7d0$211b8770$@surgitaix.com> Hi Boris, I ran into a very strange issue with xsd, that produces malformed xml documents. The original schema is very complex, so I prepared a very minimal example. Changing the name of the only element in my schema from "GetMDIB" to "GetMdib" triggers the error. These are used as root elements in an otherwise empty xml document. I get the same behaviour with a slightly more complex schema, when the element actually contains content. I also found a workaround. See the details below. I'm very confused right now. Do I miss something important here? Thank you for your help. Do you need any more information? Kind regards Matthias System configuration: Standard Ubuntu 15.04, xsd 4.0.0 from the repository, xerces-c 3.1 from the repository, gcc 4.9.2 from the repository. Schema files used: (Please note the difference in the name of the element) A.xsd B.xsd I compiled them independently to different C++ target namespaces with xsdcxx using the following command lines: xsdcxx cxx-tree --show-sloc --type-naming ucc --generate-polymorphic --polymorphic-type-all --generate-forward --generate-serialization --hxx-suffix ".hxx" --cxx-suffix ".cxx" --ixx-suffix ".ixx" --namespace-map http://message-model-uri/15/04=CDMA --std c++11 A.xsd xsdcxx cxx-tree --show-sloc --type-naming ucc --generate-polymorphic --polymorphic-type-all --generate-forward --generate-serialization --hxx-suffix ".hxx" --cxx-suffix ".cxx" --ixx-suffix ".ixx" --namespace-map http://message-model-uri/15/04=CDMB --std c++11 B.xsd My driver implementation is: #include #include #include "A.hxx" #include "B.hxx" const std::string NS("http://message-model-uri/15/04"); const std::string ENCODING("UTF-8"); int main() { { // use CDMA::GetMDIB, behaves correctly const CDMA::GetMDIB requestA; { std::ostringstream result; xml_schema::NamespaceInfomap map; CDMA::GetMDIB_(result, requestA, map, ENCODING); std::cout << result.str() << std::endl; } { std::ostringstream result; xml_schema::NamespaceInfomap map; map["p1"].name = NS; CDMA::GetMDIB_(result, requestA, map, ENCODING); std::cout << result.str() << std::endl; } { std::ostringstream result; xml_schema::NamespaceInfomap map; map["msg"].name = NS; CDMA::GetMDIB_(result, requestA, map, ENCODING); std::cout << result.str() << std::endl; } } { // use CDMB::GetMdib, has errors const CDMB::GetMdib requestB; { // has invalid namespace prefix std::ostringstream result; xml_schema::NamespaceInfomap map; CDMB::GetMdib_(result, requestB, map, ENCODING); std::cout << result.str() << std::endl; } { // has invalid namespace prefix std::ostringstream result; xml_schema::NamespaceInfomap map; map["p1"].name = NS; CDMB::GetMdib_(result, requestB, map, ENCODING); std::cout << result.str() << std::endl; } { std::ostringstream result; xml_schema::NamespaceInfomap map; map["msg"].name = NS; CDMB::GetMdib_(result, requestB, map, ENCODING); std::cout << result.str() << std::endl; } } return 0; } This implementation produces the following output, where blocks 4 and 5 are malformed: I have all source files in a default eclipse CDT (Mars) hello world project with standard compilation settings. The only change is linking against xerces-c. -------------------- Dipl.-Math. Matthias R?hser Softwareentwicklung SurgiTAIX AG, TPH 1, 2. Etage Kaiserstra?e 100 D-52134 Herzogenrath Mail: roehser@surgitaix.de I-Net: www.surgitaix.de Tel: +49 2407 555-999-0 Fax: +49 2407 555-999-1 Vorstand: Dr. Frank Portheine Vorsitzender Aufsichtsrat: Dr. Stephan Erbse Amtsgericht Aachen HRB 8474 UStIdNr. DE 215423410 From boris at codesynthesis.com Fri Aug 14 11:28:07 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Aug 14 11:28:15 2015 Subject: [xsd-users] Malformed document In-Reply-To: <006a01d0d4f6$b5b3d7d0$211b8770$@surgitaix.com> References: <006a01d0d4f6$b5b3d7d0$211b8770$@surgitaix.com> Message-ID: Hi Matthias, Matthias R?hser writes: > Changing the name of the only element in my schema from "GetMDIB" > to "GetMdib" triggers the error. I am pretty sure this is a Xerces-C++ bug that has been fixed in 3.1.2. As I remember, it boils down to incorrect comparison in a string pool implementation. Boris From roehser at surgitaix.com Mon Aug 24 04:53:07 2015 From: roehser at surgitaix.com (=?iso-8859-1?Q?Matthias_R=F6hser?=) Date: Mon Aug 24 09:40:03 2015 Subject: AW: [xsd-users] Malformed document In-Reply-To: References: <006a01d0d4f6$b5b3d7d0$211b8770$@surgitaix.com> Message-ID: <019901d0de4a$4c5f8920$e51e9b60$@surgitaix.com> Hi Boris, thanks for the hint. I found several reports about this issue, where some are several years old. However this fix has not yet been applied to the default Ubuntu xerces-c packages. So I have to stick to my workaround. Best regards Matthias -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Freitag, 14. August 2015 17:28 An: Matthias R?hser Cc: xsd-users@codesynthesis.com Betreff: Re: [xsd-users] Malformed document Hi Matthias, Matthias R?hser writes: > Changing the name of the only element in my schema from "GetMDIB" > to "GetMdib" triggers the error. I am pretty sure this is a Xerces-C++ bug that has been fixed in 3.1.2. As I remember, it boils down to incorrect comparison in a string pool implementation. Boris From boris at codesynthesis.com Mon Aug 24 12:25:48 2015 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Aug 24 12:25:51 2015 Subject: [xsd-users] RE: Compiler Error CXX-Tree parser types undeclared In-Reply-To: References: Message-ID: Hi Laurence, I managed to reproduce (what I believe is) the same problem with the original GeodesyML project I sent you. After some investigation, the error is caused by an inclusion cycle that involves type in one file and element of that type in another. There is also a pretty easy workaround for this problem: add --generate-forward option. Can you try it and see if it helps? Boris