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::ISO8601.pm' => 0,
|
||||||
'DateTime::Format::Mail.pm' => 0,
|
'DateTime::Format::Mail.pm' => 0,
|
||||||
'SVG' => 0,
|
'SVG' => 0,
|
||||||
'XML::LibXML::PrettyPrint' => 0,
|
'XML::Twig' => 0,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
$build->create_build_script;
|
$build->create_build_script;
|
||||||
|
@ -10,8 +10,7 @@ use BurguillosInfo::Posts;
|
|||||||
|
|
||||||
use DateTime::Format::ISO8601;
|
use DateTime::Format::ISO8601;
|
||||||
|
|
||||||
use XML::LibXML;
|
use XML::Twig;
|
||||||
use XML::LibXML::PrettyPrint;
|
|
||||||
|
|
||||||
use Mojo::Base 'Mojolicious::Controller', '-signatures';
|
use Mojo::Base 'Mojolicious::Controller', '-signatures';
|
||||||
|
|
||||||
@ -27,10 +26,8 @@ sub sitemap ($self) {
|
|||||||
$self->_append_category_dom( $dom, $category_key, $categories );
|
$self->_append_category_dom( $dom, $category_key, $categories );
|
||||||
}
|
}
|
||||||
my $xml_string = "$dom";
|
my $xml_string = "$dom";
|
||||||
my $document = XML::LibXML->load_xml(string => $xml_string);
|
my $document = XML::Twig->new(pretty_print=> 'indented');
|
||||||
my $pretty_print = XML::LibXML::PrettyPrint->new(indent_string => (" " x 4));
|
$xml_string = $document->parse($xml_string)->sprint;
|
||||||
$pretty_print->pretty_print($document);
|
|
||||||
$xml_string = $document->toString();
|
|
||||||
$self->render(text => $xml_string, format => 'xml');
|
$self->render(text => $xml_string, format => 'xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user