[xsd-users] losing double precision in output xml (msvc++7.1)

Fred Campaigne fcampaigne at accesswave.ca
Tue Mar 14 19:32:00 EST 2006


Just started using xsd and it is a hit.  Makes machine generated xml a 
breeze.  I am having a problem with loss of precision of doubles in the 
output xml, as follows:

std::ostream ofs("outfile.xml", std::ios_base::binary);   //non binary 
is the same
ofs.precision(12);   //values used in the cxx-tree generated objects are 
accurate to many places
GridSearchData(ofs, *gsd, map);   //generate the xml to ofs
 std::cout << ofs.precision() << std::endl;  // this prints 12

and my double precision latitudes and longitude have float precision in 
the streamed xml.
I probably missed something in the notes and email archives.  Any help 
would be very much appreciated.

cheers Fred









More information about the xsd-users mailing list