From a2c0093cd8a0e9633bba0a2e1a520a73c725a628 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 7 Jan 2009 14:39:04 +0000 Subject: i feed dei tag vanno! git-svn-id: svn://luxion/repos/WebCoso/trunk@405 fcb26f47-9200-0410-b104-b98ab5b095f3 --- lib/WebCoso/XSLT.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/WebCoso') diff --git a/lib/WebCoso/XSLT.pm b/lib/WebCoso/XSLT.pm index 09c5b3f..9cbeab0 100644 --- a/lib/WebCoso/XSLT.pm +++ b/lib/WebCoso/XSLT.pm @@ -7,6 +7,7 @@ use XML::LibXML; use XML::LibXSLT; use DateTime::Format::Strptime; use Log::Log4perl ':easy'; +use Data::Dumper; my $NS='http://webcoso.thenautilus.net/'; @@ -99,10 +100,17 @@ sub fillFeed { sub setXMLTagsSource { my ($self,$source)=@_; - $self->{tags_source}=$source; + # the weird copy seems to be needed, otherwise sometimes it looks empty + $self->{tags_source}=(defined $source) ? {%$source} : undef; + delete $self->{tags_document}; } sub getTagsXML { my ($self)=@_; + if (defined $self->{tags_document}) { + DEBUG('returing cached TagsXML'); + return $self->{tags_document} + } + DEBUG('building TagsXML'); my $doc=XML::LibXML::Document->new(); return $doc unless defined $self->{tags_source}; @@ -127,7 +135,7 @@ sub getTagsXML { } } } - return $doc; + return $self->{tags_document}=$doc; } { -- cgit v1.2.3