Changing LibXML to Twig.
This commit is contained in:
parent
423e813490
commit
50abdc0ac4
2
Build.PL
2
Build.PL
@ -18,7 +18,7 @@ my $build = Module::Build->new(
|
||||
'DateTime::Format::ISO8601.pm' => 0,
|
||||
'DateTime::Format::Mail.pm' => 0,
|
||||
'SVG' => 0,
|
||||
'XML::LibXML::PrettyPrint' => 0,
|
||||
'XML::Twig' => 0,
|
||||
},
|
||||
);
|
||||
$build->create_build_script;
|
||||
|
@ -10,8 +10,7 @@ use BurguillosInfo::Posts;
|
||||
|
||||
use DateTime::Format::ISO8601;
|
||||
|
||||
use XML::LibXML;
|
||||
use XML::LibXML::PrettyPrint;
|
||||
use XML::Twig;
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', '-signatures';
|
||||
|
||||
@ -27,10 +26,8 @@ sub sitemap ($self) {
|
||||
$self->_append_category_dom( $dom, $category_key, $categories );
|
||||
}
|
||||
my $xml_string = "$dom";
|
||||
my $document = XML::LibXML->load_xml(string => $xml_string);
|
||||
my $pretty_print = XML::LibXML::PrettyPrint->new(indent_string => (" " x 4));
|
||||
$pretty_print->pretty_print($document);
|
||||
$xml_string = $document->toString();
|
||||
my $document = XML::Twig->new(pretty_print=> 'indented');
|
||||
$xml_string = $document->parse($xml_string)->sprint;
|
||||
$self->render(text => $xml_string, format => 'xml');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user