#
#
# Use newly created helper
my $xrd = $c->new_hostmeta;
# Create a document based on the defined xml profile
$xrd->host('sojolicio.us');
# Render document with the correct mime-type
$c->render_xml($xrd);
# Content-Type: application/xrd+xml
#
#
# sojolicio.us
#
=head1 DESCRIPTION
L is a plugin to support
XML document generation based on L.
=head1 METHODS
L inherits all methods
from L and implements the following
new ones.
=head2 register
# Mojolicious
$mojo->plugin(XML::Loy => {
max_size => 2048,
new_activity => [-Atom, -ActivityStreams]
});
# Mojolicious::Lite
plugin XML::Loy => {
new_activity => [-Atom, -ActivityStreams]
};
# In your config file
{
XML::Loy => {
new_activity => [-Atom, -ActivityStreams]
}
};
Called when registering the plugin.
Accepts new xml profiles, defined by the
name of the associated generation helper
and an array reference defining the profile.
The first element in the array is the base class,
followed by all extensions.
To create a helper extending the base class,
use C as the first element.
$mojo->plugin('XML::Loy' => {
new_myXML => [-Loy, 'MyXML::Loy::Extension']
});
In addition to that, the C in bytes of xml documents
to be parsed can be defined (defaults to C<1024 * 1024>).
All parameters can be set either on registration or
as part of the configuration file with the key C.
B The C parameter is DEPRECATED.
=head1 HELPERS
=head2 new_xml
my $xml = $c->new_xml('entry');
print $xml->to_pretty_xml;
Creates a new generic L document.
All helpers created on registration accept
the parameters as defined in the constructors of
the L base classes.
=head2 render_xml
$c->render_xml($xml);
$c->render_xml($xml, status => 404);
Renders documents based on L
using the defined mime-type of the base class.
=head1 DEPENDENCIES
L,
L.
=head1 AVAILABILITY
https://github.com/Akron/Mojolicious-Plugin-XML-Loy
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2011-2013, L.
This program is free software, you can redistribute it
and/or modify it under the same terms as Perl.
=cut