Thanks for the notice about my patch, i'll try to find a way around.
Talking about JSON, I am not seeing any other options actually, than
looking into SV. It's the only way to check type of the scalar, beside
having scalar stored into object. So the options are:
* having objects (slow down and overcomplicate things);
* having everything stringified in json;
* look into SV.
Bonus option: use language with strict types.
About making every key in json a string
{ "MapPoint" : { x : "10.2", y : "45.9" } }
this json code will break deserialization for strict typing languages like,
java. If x and y is floats in java.
Do I miss something?
On Tue, Dec 16, 2014 at 3:07 PM, Mark Overmeer <[email protected]> wrote:
>
> * Mark Overmeer ([email protected]) [141207 12:57]:
> > * hmepas ([email protected]) [141207 08:58]:
> > > Then if we converting to json structure which came out after
> XML::Compile
> > > deserialization, floats and decimals will be like "3.14".
> >
> > The patch is accepted for next release.
>
> I have to revert the change, triggered by a failing regression test.
>
> When I read the JSON docs:
> my $value = 5; encode_json [$value] # yields [5]
>
> # used as string, so dump as string
> print $value;
> encode_json [$value] # yields ["5"]
>
> Your patch does work for simple floats in the XML, but it will not
> work for floats which have additional facets (totalDigits, fracDigits,
> length). Those checks are done after stringification.
>
> So, your patch does break validation for everyone. Any use of facets
> will break your JSON trick. So: your patch does not work. Sorry.
>
> It would be nice to add an option to JSON to disable its "smart"
> behavior. Application libraries should not look into the SV!
> --
> Regards,
>
> MarkOv
>
> ------------------------------------------------------------------------
> Mark Overmeer MSc MARKOV Solutions
> [email protected] [email protected]
> http://Mark.Overmeer.net http://solutions.overmeer.net
>
>
--
Pavel S. Khmelinsky <[email protected]>
Jabber: [email protected]
Skype: hmepas
_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile