[Xml-compile] $_[0] + 0.0 for sloppy floats
hmepas
hmepas at gmail.com
Sat Dec 6 21:12:33 GMT 2014
Hello fellas.
I stumbled into annoying problem. When I deserializing my XML, I am getting
integers as Perl integers, while anything what's sloppy_floats became
strings. (And yes I have that enabled)
To patch that i just altered sloppy_float type translation in
XML::Compile::Schema::BuiltInTypes
like this
295 $builtin_types{sloppy_float} =
296 {
297 parse => sub { $_[0] + 0.0 },
298 check => sub {
299 my $v = eval {use warnings FATAL => 'all'; $_[0] + 0.0};
300 $@ ? undef : 1;
301 }
302 , example => '3.1415'
303 , extends => 'anyAtomicType'
304 };
look at 297 line.
And it's works. Any chance it's getting patched in mainstream?
--
Pavel S. Khmelinsky <hmepas at gmail.com>
Jabber: hmepas at gmail.com
Skype: hmepas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20141207/c008e935/attachment.htm>
More information about the Xml-compile
mailing list