aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2010-02-17 23:09:54 +0000
committerdakkar <dakkar@thenautilus.net>2010-02-17 23:09:54 +0000
commitdb409bf305724346fd729c7cba8021db990866da (patch)
treeba4d3ae0db068383d1ca06296491ecc8cb266b90
parentdon't call parsers on not-found files (diff)
downloadWebCoso-db409bf305724346fd729c7cba8021db990866da.tar.gz
WebCoso-db409bf305724346fd729c7cba8021db990866da.tar.bz2
WebCoso-db409bf305724346fd729c7cba8021db990866da.zip
create empty doc element for empty docs
-rw-r--r--lib/WebCoso/XSLT.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/WebCoso/XSLT.pm b/lib/WebCoso/XSLT.pm
index 8daa912..6caed71 100644
--- a/lib/WebCoso/XSLT.pm
+++ b/lib/WebCoso/XSLT.pm
@@ -120,10 +120,11 @@ sub getTagsXML {
}
DEBUG('building TagsXML');
my $doc=XML::LibXML::Document->new();
- return $doc unless defined $self->{tags_source};
my $de=$doc->createElementNS($NS,'wc:tags');
$doc->setDocumentElement($de);
+ return $doc unless defined $self->{tags_source};
+
my ($tagname,$doclist);
while (($tagname,$doclist)=each %{$self->{tags_source}}) {
my $te=$doc->createElementNS($NS,'wc:tag');
@@ -164,10 +165,11 @@ sub getChangesXML {
}
DEBUG('building ChangesXML');
my $doc=XML::LibXML::Document->new();
- return $doc unless defined $self->{changes_source};
my $de=$doc->createElementNS($NS,'wc:changes');
$doc->setDocumentElement($de);
+ return $doc unless defined $self->{changes_source};
+
my ($docpath,$dates);
while (($docpath,$dates)=each %{$self->{changes_source}}) {
my $te=$doc->createElementNS($NS,'wc:document');