From 53b3268dbd0d3a13b89243c28215ff071ce99bb5 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 7 Jan 2009 12:59:49 +0000 Subject: messi i tag / category nel feed git-svn-id: svn://luxion/repos/WebCoso/trunk@403 fcb26f47-9200-0410-b104-b98ab5b095f3 --- lib/WebCoso/Common.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/WebCoso') diff --git a/lib/WebCoso/Common.pm b/lib/WebCoso/Common.pm index eed6f3a..46f63b6 100644 --- a/lib/WebCoso/Common.pm +++ b/lib/WebCoso/Common.pm @@ -138,6 +138,25 @@ sub getDatesFor { } } +sub getTagsFor { + my ($fc,$lang,$path,$name)=@_; + + DEBUG("getTagsFor($lang,$path,$name)"); + my $doc_name=srcXMLFor($lang,$path,$name); + my $doc=$fc->get($doc_name); + unless ($doc) { + LOGWARN("No document for <$doc_name>, returning <>"); + return; + } + + my @tags=map {$_->textContent} + $xpath->findnodes( + q{/document/docinfo/field[field_name='tags']/field_body/*/list_item|/document/docinfo/field[field_name='tags']/field_body/paragraph}, + $doc); + chomp for @tags; + return @tags; +} + sub getDates { my ($fc,@docs)=@_; -- cgit v1.2.3