Subject: | xml2yaml -bigfloats |
The attached patch adds the bigfloats switch to xml2yaml and default now
to use sloppy floats. With this patch gpx2yaml again looks fine.
Regards,
Slaven
Subject: | xml2yaml-bigfloats.diff |
--- /usr/local/bin/xml2yaml 2008-10-06 12:54:09.000000000 +0200
+++ xml2yaml 2008-11-12 13:16:58.000000000 +0100
@@ -11,10 +11,11 @@ use XML::Compile::Util qw/type_of_node
use Getopt::Long qw/GetOptions :config gnu_compat bundling/;
use YAML qw/Dump/;
-my ($xml_input, $root_type, @schemas, $bigints, $yaml_out);
+my ($xml_input, $root_type, @schemas, $bigints, $bigfloats, $yaml_out);
GetOptions
"bigints|b!" => \$bigints
+ , "bigfloats|bf!" => \$bigfloats
, "output|o=s" => \$yaml_out
, "schema|s=s" => \@schemas
, "type|t=s" => \$root_type
@@ -52,6 +53,7 @@ my $schema = XML::Compile::Schema->new(
my $read = $schema->compile
( READER => $root_type
, sloppy_integers => !$bigints
+ , sloppy_floats => !$bigfloats
);
my $data = Dump $read->($top);