aboutsummaryrefslogtreecommitdiff
path: root/lib/WebCoso/Common.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebCoso/Common.pm')
-rw-r--r--lib/WebCoso/Common.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/WebCoso/Common.pm b/lib/WebCoso/Common.pm
index 7b610f2..665de33 100644
--- a/lib/WebCoso/Common.pm
+++ b/lib/WebCoso/Common.pm
@@ -20,19 +20,19 @@ $xpath->registerNs('x', 'http://www.w3.org/1999/xhtml');
sub langOf {
my ($name)=@_;
- $name=~m{(^|/)document\.([^.]+)(\.|$)} and return $2;
+ $name=~m{(^|/)(?:document|feed)\.([^.]+)(\.|$)} and return $2;
return;
}
sub typeOf {
my ($name)=@_;
- $name=~m{(^|/)document\.[^.]+\.([^.]+\.[^.]+)$} and return $2;
+ $name=~m{(^|/)(?:document|feed)\.[^.]+\.((?:[^.]+\.)*[^.]+)$} and return $2;
return;
}
sub typedAs {
my ($name,$newtype)=@_;
- $name=~s{(^|/)(document\.[^.]+\.)([^.]+\.[^.]+)$}{$1$2$newtype};
+ $name=~s{(^|/)((?:document|feed)\.[^.]+\.)((?:[^.]+\.)*[^.]+)$}{$1$2$newtype};
return $name;
}
@@ -172,6 +172,7 @@ sub fromTo {
else {
push @ret,$file while $file=$iter->();
}
+ DEBUG("fromTo: @ret");
return uniq(@ret);
}
@@ -214,7 +215,10 @@ our %docfiles=(
files=>sub{m{^document\.}},
dirs=>sub{!m{^(tags$|_|\.)}});
our %feedfiles=(
- files=>sub{m{^feed\.[.]+\.tt$}},
- dirs=>sub{!m{^[^_.]}});
+ files=>sub{m{^feed\.[^.]+\.tt$}},
+ dirs=>sub{!m{^[_.]}});
+our %feedfilesXML=(
+ files=>sub{m{^feed\.[^.]+\.xml$}},
+ dirs=>sub{!m{^[_.]}});
1;