From: <jen...@us...> - 2012-10-31 10:09:31
|
Revision: 17444 http://sourceforge.net/p/exist/code/17444 Author: jenspetersen Date: 2012-10-31 10:09:28 +0000 (Wed, 31 Oct 2012) Log Message: ----------- [tamboti] Cardinality error. Modified Paths: -------------- apps/tamboti/modules/edit/edit.xq Modified: apps/tamboti/modules/edit/edit.xq =================================================================== --- apps/tamboti/modules/edit/edit.xq 2012-10-31 04:02:30 UTC (rev 17443) +++ apps/tamboti/modules/edit/edit.xq 2012-10-31 10:09:28 UTC (rev 17444) @@ -256,17 +256,22 @@ (:If the record is hosted by a record linked to through an xlink, display the title of this record. Only the xlink on the first relatedItem with type host is treated.:) let $related-publication-xlink := doc($record-data)/mods:mods/mods:relatedItem[@type eq 'host'][1]/@xlink:href/string() - let $related-publication-xlink := replace($related-publication-xlink, '^#?(.*)$', '$1') - let $related-publication := collection($config:mods-root)//mods:mods[@ID eq $related-publication-xlink][1] - let $related-publication := modsCommon:get-short-title($related-publication) + let $related-publication-xlink-clear := + if ($related-publication-xlink) + then replace($related-publication-xlink[1], '^#?(.*)$', '$1') + else () + let $related-publication := + if ($related-publication-xlink-clear) + then modsCommon:get-short-title(collection($config:mods-root)//mods:mods[@ID eq $related-publication-xlink-clear]) + else () let $related-publication := - if ($related-publication-xlink) - then - if (count($related-publication-xlink) eq 1) - then (<span class="intro">The publication is included in </span>, <a href="../../modules/search/index.html?filter=ID&value={$related-publication-xlink}" target="_blank">{$related-publication}</a>,<span class="intro">.</span>) - else (<span class="intro">The publication is included in more than one publication.</span>) - else () - return + if (count($related-publication-xlink) eq 1) + then (<span class="intro">The publication is included in </span>, <a href="../../modules/search/index.html?filter=ID&value={$related-publication-xlink-clear}" target="_blank">{$related-publication}</a>,<span class="intro">.</span>) + else + if (count($related-publication-xlink) gt 1) + then (<span class="intro">The publication is included in more than one publication.</span>) + else () + return <div class="content"> <span class="info-line"> { |