I had some issues with saving exponential notation
floats attributes with TinyXml (near 1e-10 in my case).
Replacing the %f (fixed point notation) by a %g (normal
or exponential notation) in the sprintf call of
TiXmlElement::SetDoubleAttribute(...) seems to fix the
problem.
Regards,
Julien Rouviere
Here is the 'tiny' unified diff for TinyXml 2.4.3
--- X:\tinyxml\tinyxml0.cpp Wed Aug 23 17:10:38 2006
+++ X:\tinyxml\tinyxml.cpp Wed Aug 23 16:52:48 2006
@@ -752,9 +752,9 @@
{
char buf[256];
#if defined(TIXML_SNPRINTF)
- TIXML_SNPRINTF( buf, sizeof(buf), "%f", val );
+ TIXML_SNPRINTF( buf, sizeof(buf), "%g", val );
#else
- sprintf( buf, "%f", val );
+ sprintf( buf, "%g", val );
#endif
SetAttribute( name, buf );
}