Windows and xslt dll

Lubomir I. Ivanov neolit123 at gmail.com
Wed Mar 6 05:43:02 PST 2013


On 6 March 2013 15:05, Robert C. Helling <helling at lmu.de> wrote:
> On Wed, 6 Mar 2013, Rainer Mohr wrote:
>
> Hi,
>
>
>> So it would be best to not rely on the float values that the dll returns
>> and instead parse the float from the XML yourself...
>
>
> I don't know anything about Windows but I would assume that there is a
> corresponding function that parses strings into floats using the current
> locale (and one might think about using this in other places as well as
> mentioned yesterday but this of course opens a whole new can of worms as
> then the xml might become locale dependent etc).
>

it could be that XSLT uses strtod() internally, which is locale bound
and not much can be done (unless we modify XSLT).

glib has a g_ascii_strtod():
https://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html#g-ascii-strtod

but since the cylinder volume is stored in milliliters, it would be
probably better to parse using:

sscanf(buf, "%d.%d", &integral, &fraction)
cyl.size.mliter = (integral * 1000) +  fraction.

lubomir
--


More information about the subsurface mailing list