[xsd-users] Runtime exception if using istream while string is working

Bernhard Rapp bernhard.rapp at student.tugraz.at
Fri Dec 9 10:03:24 EST 2016


Hi,
I'm new to xsd-users and xml-data-binding.

I want to extend the hello example [1] to work with a file or  
stringstream [2]:
std::string xml_file = "path-to-file\\hello.xml";
std::ifstream ifs(xml_file);

std::unique_ptr<hello_t> h(hello(ifs, "hello.xml"));

Taken from:
[1]  
http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#2.3
[2]  
http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.5
as you can see, I use --std c++11

----------------------------------------------------
What problems do I have:
If I use the code above and run it, I get:
...exception: xercesc_3_1::RuntimeException at memory location ....
...xsd::cxx::tree::parsing<char> at memory location ...

While the example code works like a charm!

Does anybody can point me in a direction to look at?

-----------------------------------------------------
Additional information:
* xsd-4.0.0-i686-windows (just used the zip file...)
* MS Visal Studio 2015 (C++11)
* Xcerces-c-3.1.4 (I compiled it on my own because I got errors by  
using the NuGet)
* C++/Tree Mapping options: --std C++11 --generate-inline  
--generate-forward --generate-serialization --gnerate-ostream
* precompiler: XERCES_STATIC_LIBRARY (because I got problems with the DLL)
* additional dependencies (for now I point directly to the lib, is  
there maybe a version mismatch which cause the runtime exception?)

I really can't find anything which helps me here. Seems like everybody  
using the xml file name...

Thanks a lot in advance,
sorry if i forgot something!,
Bernhard




More information about the xsd-users mailing list