aboutsummaryrefslogtreecommitdiff
path: root/lib/WebCoso/XSLT.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebCoso/XSLT.pm')
-rw-r--r--lib/WebCoso/XSLT.pm19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/WebCoso/XSLT.pm b/lib/WebCoso/XSLT.pm
index e5ca549..36c22f3 100644
--- a/lib/WebCoso/XSLT.pm
+++ b/lib/WebCoso/XSLT.pm
@@ -125,15 +125,15 @@ sub getTagsXML {
$doc->setDocumentElement($de);
return $doc unless defined $self->{tags_source};
- my ($tagname,$doclist);
- while (($tagname,$doclist)=each %{$self->{tags_source}}) {
+ for my $tagname (sort keys %{$self->{tags_source}}) {
+ my $doclist = $self->{tags_source}{$tagname};
my $te=$doc->createElementNS($NS,'wc:tag');
$te->setAttribute('name',$tagname);
$de->appendChild($te);
my %docs;
push @{$docs{WebCoso::Common::dstUriFor($_)}},WebCoso::Common::langOf($_) for @$doclist;
- my ($docurl,$langs);
- while (($docurl,$langs)=each %docs) {
+ for my $docurl (sort keys %docs) {
+ my $langs = $docs{$docurl};
my $dle=$doc->createElementNS($NS,'wc:doc');
$dle->setAttribute('uri',$docurl||'ERRORE');
$te->appendChild($dle);
@@ -170,15 +170,15 @@ sub getChangesXML {
$doc->setDocumentElement($de);
return $doc unless defined $self->{changes_source};
- my ($docpath,$dates);
- while (($docpath,$dates)=each %{$self->{changes_source}}) {
+ for my $docpath (sort keys %{$self->{changes_source}}) {
+ my $dates = $self->{changes_source}{$docpath};
my $te=$doc->createElementNS($NS,'wc:document');
$te->setAttribute('path',$docpath);
$te->setAttribute('uri',WebCoso::Common::dstUriFor($docpath));
$te->setAttribute('lang',WebCoso::Common::langOf($docpath));
$de->appendChild($te);
- my ($type,$value);
- while (($type,$value)=each %$dates) {
+ for my $type (sort keys %$dates) {
+ my $value = $dates->{$type};
my $dle=$doc->createElementNS($NS,$name_map{$type});
$dle->appendTextNode($format->format_datetime($value));
$te->appendChild($dle);
@@ -194,7 +194,8 @@ sub getDatesXML {
my $de=$doc->createElementNS($NS,'wc:dates');
$doc->setDocumentElement($de);
- while (my ($k,$v)=each %$dates) {
+ for my $k (sort keys %$dates) {
+ my $v = $dates->{$k};
my $d=$doc->createElementNS($NS,$name_map{$k});
$d->appendTextNode($format->format_datetime($v));
$de->appendChild($d);