Support for XML serialization in Dancer2
The Dancer2::Cookbook suggests that, when writing REST applications with Dancer2, it should be easy to serialize data to XML as well as to JSON, YAML and Data::Dumper. (See: https://metacpan.org/source/XSAWYERX/Dancer2-0.200002/lib/Dancer2/Cookbook.p....) However, there exists no Dancer2::Serializer::XML package, so this part of the Cookbook is misleading. The absence of XML support came up in this StackOverflow thread: http://stackoverflow.com/questions/28236767/how-can-i-use-xml-serializer-in-.... A first draft of a Dancer2::Serializer::XML package was provided there by Daniel Böhmer. Granted, it uses XML::Simple, whose maintainer discourages new usage of that library. But apart from this, is there any reason why to date there is no support for XML serialization in Dancer2? Thank you very much. Jim Keenan
On 07/10/2016 08:36 AM, James E Keenan wrote:
The Dancer2::Cookbook suggests that, when writing REST applications with Dancer2, it should be easy to serialize data to XML as well as to JSON, YAML and Data::Dumper. (See: https://metacpan.org/source/XSAWYERX/Dancer2-0.200002/lib/Dancer2/Cookbook.p....) However, there exists no Dancer2::Serializer::XML package, so this part of the Cookbook is misleading.
Similarly misleading information in Dancer2::Manual; see https://metacpan.org/source/XSAWYERX/Dancer2-0.200002/lib/Dancer2/Manual.pod...
The absence of XML support came up in this StackOverflow thread: http://stackoverflow.com/questions/28236767/how-can-i-use-xml-serializer-in-.... A first draft of a Dancer2::Serializer::XML package was provided there by Daniel Böhmer. Granted, it uses XML::Simple, whose maintainer discourages new usage of that library. But apart from this, is there any reason why to date there is no support for XML serialization in Dancer2?
Thank you very much. Jim Keenan _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Hi James, I am one of the authors in the Stackoverflow question you linked. As I stated in my SO answer I just posted a simple draft of an XML module to get the OP started. I generally don't like XML that much and used the XML code from the Dancer1 plugin. As my answer is a community answer you're free to change the XML module to something more favorable. Since January 2015 I've made some progress with Dancer2 and also released my first CPAN module (which is actually a Dancer2 plugin). If you had benefit from it and somebody from the Dancer team would approve my draft I could make a release. What do you think? Kind regards Daniel Böhmer --- Daniel Böhmer Freelance Software Developer On 2016-07-10 14:40, James E Keenan wrote:
On 07/10/2016 08:36 AM, James E Keenan wrote:
The Dancer2::Cookbook suggests that, when writing REST applications with Dancer2, it should be easy to serialize data to XML as well as to JSON, YAML and Data::Dumper. (See: https://metacpan.org/source/XSAWYERX/Dancer2-0.200002/lib/Dancer2/Cookbook.p....) However, there exists no Dancer2::Serializer::XML package, so this part of the Cookbook is misleading.
Similarly misleading information in Dancer2::Manual; see https://metacpan.org/source/XSAWYERX/Dancer2-0.200002/lib/Dancer2/Manual.pod...
The absence of XML support came up in this StackOverflow thread: http://stackoverflow.com/questions/28236767/how-can-i-use-xml-serializer-in-.... A first draft of a Dancer2::Serializer::XML package was provided there by Daniel Böhmer. Granted, it uses XML::Simple, whose maintainer discourages new usage of that library. But apart from this, is there any reason why to date there is no support for XML serialization in Dancer2?
Thank you very much. Jim Keenan _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 07/10/2016 09:29 AM, Daniel Böhmer wrote:
Hi James,
I am one of the authors in the Stackoverflow question you linked.
As I stated in my SO answer I just posted a simple draft of an XML module to get the OP started. I generally don't like XML that much and used the XML code from the Dancer1 plugin.
XML is not as fashionable as JSON is these days, but there's still a lot of it around. It seems to have been supported in Dancer 1. And it seems it would be almost trivially easy to support in Dancer 2.
As my answer is a community answer you're free to change the XML module to something more favorable.
I think it's a tremendous starting point. I'm just wondering why it hasn't been implemented already. Thank you very much. Jim Keenan
participants (2)
-
Daniel Böhmer -
James E Keenan