From 196506b7e6ac4a2e5f362c1d86e91ffc401f7f06 Mon Sep 17 00:00:00 2001
From: Gerhard Gonter <ggonter@gmail.com>
Date: Wed, 30 Apr 2025 18:51:35 +0200
Subject: [PATCH] added indication if XML file cache was used

---
 modules/util/Util/XML/File.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/util/Util/XML/File.pm b/modules/util/Util/XML/File.pm
index 5072094..914eb98 100644
--- a/modules/util/Util/XML/File.pm
+++ b/modules/util/Util/XML/File.pm
@@ -41,10 +41,10 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c
     while (<FI>) { $xml .= $_ };
     close (FI);
 
-    $xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1);
+    $xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ]);
 
     # TODO: if the file is not ok, ignore the cached file and refetch
-    return ($xmlref, $xml);
+    return ($xmlref, $xml, 1);
   }
 
   print __LINE__, " fetch_xml_file: url=[$url]\n";
@@ -52,7 +52,7 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c
 
   unless ($res->is_success)
   {
-    print "ERROR: Aleph-XML-Query (find) failed: ", $res->status_line, "\n";
+    print "ERROR: XML retrieval failed: ", $res->status_line, "\n";
     return undef;
   }
 
@@ -74,10 +74,10 @@ print __LINE__, " fetch: xml=[$xml]\n" if ($DEBUG > 0);
      # TODO: else report that we can not write to the cache as we should
   }
 
-  $xmlref= XMLin ($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ] );
+  $xmlref= XMLin ($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ]);
 print __LINE__, " xmlref: ", main::Dumper ($xmlref) if ($DEBUG > 0);
 
-  return ($xmlref, $xml);
+  return ($xmlref, $xml, 0);
 }
 
 sub save
-- 
GitLab