t Mojolicious version > 7.77
# - "ns|*" namespace selector
#
# - Add ->clone
# (Maybe via JSON serialisation of ->tree or using Storable or Dumper)
#
# Maybe necessary: *AUTOLOAD = \&XML::Lo
package XML::Loy::XRD;
use strict;
use warnings;
use Mojo::JSON qw/encode_json decode_json/;
use Mojo::Util 'quote';
use Carp qw/carp/;
use XML::Loy::Date::RFC3339;
use XML::Loy with => (
mime
ert to xml
sub _to_xml {
my $xrd = shift;
# Parse json document
my $jrd;
# There may be a parsing error
eval {
$jrd = decode_json $_[0];
} or carp $@;
# Itterate over all XRD elem
if ($key eq 'titles') {
_to_xml_titles($xrd, $jrd->{$key});
};
};
};
# Convert From JSON to XML
sub _to_xml_titles {
my ($node, $hash) = @_;
foreach (keys %$hash) {
# Default
fix => 'activity',
namespace => 'http://activitystrea.ms/schema/1.0/'
);
# Todo: support to_json
# Todo: verbs and object-types may need namespaces
# Todo: Support ActivityStreams 2 as a anamesp
L<Mojolicious>.
=head1 LIMITATIONS
L<XML::Loy::ActivityStreams> has currently no support for
JSON serialization, neither on reading nor writing.
=head1 AVAILABILITY
https://github.com/Akron/