From 6139331b9c46136cbd8c501ee497ad381ec489e6 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 11 May 2010 16:19:37 +0100 Subject: [PATCH] Display value of Multiple OPAC Records test. calc_nrs() refactored to extract _calc_boolean(), which is also used by the new calc_mor(). --- web/htdocs/details/full.mc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/htdocs/details/full.mc b/web/htdocs/details/full.mc index 19008a9..0ff52e6 100644 --- a/web/htdocs/details/full.mc +++ b/web/htdocs/details/full.mc @@ -49,6 +49,7 @@ if ($n == 0) { [ "Named Result Sets" => \&calc_nrs, $xc ], [ "Record syntaxes" => \&calc_recsyn, $xc ], [ "Explain" => \&calc_explain, $xc ], + [ "Multiple OPAC records" => \&calc_mor, $xc ], ); my $title = $xc->find("e:databaseInfo/e:title"); @@ -170,10 +171,13 @@ sub calc_boolean { return $res; } -sub calc_nrs { - my($id, $xc) = @_; +sub calc_nrs { _calc_boolean(@_, 'i:status/i:named_resultset[@ok = "1"]') } +sub calc_mor { _calc_boolean(@_, 'i:status/i:multiple_opac[@ok = "1"]') } + +sub _calc_boolean { + my($id, $xc, $xpath) = @_; - my @nodes = $xc->findnodes('i:status/i:named_resultset[@ok = "1"]'); + my @nodes = $xc->findnodes($xpath); return @nodes ? "Yes" : "No"; } -- 1.7.10.4