From: Mike Taylor Date: Fri, 20 Oct 2006 16:57:23 +0000 (+0000) Subject: Use new utility function irspy_xpath_context() X-Git-Tag: CPAN-v1.02~54^2~888 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=4251adda38740fd055badc12ee9996c63bc37c90 Use new utility function irspy_xpath_context() Title now links to full record display. Add link to edit record. Test/Edit/Raw links are now in a single table column. --- diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index c306375..ebe7367 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,7 +1,5 @@ -%# $Id: found.mc,v 1.14 2006-10-18 14:03:42 mike Exp $ +%# $Id: found.mc,v 1.15 2006-10-20 16:57:23 mike Exp $ <%once> -use XML::LibXML; -use XML::LibXML::XPathContext; use URI::Escape; sub print_navlink { @@ -61,7 +59,6 @@ if (!defined $conn) { $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1"); $conn->option(elementSetName => "zeerex"); } -my $parser = new XML::LibXML(); my $rs; eval { $rs = $conn->search(new ZOOM::Query::CQL($query)) }; @@ -116,11 +113,7 @@ print_navlink(\%params, $last < $n, "Next", $skip+$count); % foreach my $i ($first .. $last) { <%perl> my $rec = $rs->record($i-1); -my $xml = $rec->render(); -my $doc = $parser->parse_string($xml); -my $root = $doc->getDocumentElement(); -my $xc = XML::LibXML::XPathContext->new($root); -$xc->registerNs(e => 'http://explain.z3950.org/dtd/2.0/'); +my $xc = irspy_xpath_context($rec); my $title = $xc->find("e:databaseInfo/e:title"); my $author = $xc->find("e:databaseInfo/e:author"); my $host = $xc->find("e:serverInfo/e:host"); @@ -133,15 +126,20 @@ push @ids, $id; <% $i %> - <% xml_encode($title) %> + <% xml_encode($title) %> <% xml_encode($author) %> <% xml_encode($host) %> <% xml_encode($port) %> <% xml_encode($db) %> - [Test] - [Raw] + + T E X + % }