Hello Solomon,
I'm sorry if I can't pinpoint what's causing that error but here's what I
did in our repository. In your item-view.xsl, locate this line of code:
<xsl:template name="itemSummaryView-DIM">
<!-- Generate the info about the item from the metadata section -->
<xsl:apply-templates
select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim"
mode="itemSummaryView-DIM"/>
After that piece of code, copy paste these javascript code:
<script type="text/javascript">
<xsl:text disable-output-escaping="yes">
document.write('<script type="text/javascript" src="
http://api.elsevier.com/javascript/scopussearch.jsp"> </' +
'script>');
callbackCitedbycount = function(){
if (sciverse.areSearchResultsValid()) {
var resultObj = sciverse.getSearchResults();
if (resultObj.returnedResults >0) {
citedbycount = resultObj.results[0].citedbycount;
eid = resultObj.results[0].eid;
if (citedbycount > 0) {
citeHtml = '<span
class="bold">Cited:</span> ';
if (eid != null) {
citeHtml += '<a href="
http://www.scopus.com/scopus/search/submit/citedby.url?src=s&origin=recordpage&eid=
';
citeHtml += eid;
citeHtml += '" class="citing-link"
target="_new" title="View citing articles in Scopus">';
citeHtml += citedbycount;
citeHtml += '</a> times in
<span class="bold">Scopus</span>';
}
articleLink = resultObj.results[0].inwardurl;
if (articleLink != null) {
citeHtml +=
'  <small>(<a href="';
citeHtml += articleLink;
citeHtml += '" class="article-link"
target="_new" title="View record in Scopus" >';
citeHtml += 'View record in Scopus';
citeHtml += '</a>)</small>';
}
</xsl:text>
var citecountsScopus = $("#citecounts-scopus");
citecountsScopus.html(citeHtml);
citecountsScopus.removeClass('hidden');
citecountsScopus.show('blind');
$("#citecounts-scopus
a.citing-link").click(function(){
if (_gaq != null) {
_gaq.push(['_trackEvent', 'Citecount
links','Scopus citing items','<xsl:value-of
select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier'
and @qualifier='uri']"/>']);
}
});
$("#citecounts-scopus
a.article-link").click(function(){
if (_gaq) {
_gaq.push(['_trackEvent','Citecount
links','Scopus article','<xsl:value-of
select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier'
and @qualifier='uri']"/>']);
}
});
}
}
}
}
runSearch = function() {
//setting defaults
sciverse.setApiKey("*REPLACE-THIS-WITH-YOUR-SCOPUS-API-KEY*");
sciverse.setCallback(callbackCitedbycount);
//setting search query
<xsl:text disable-output-escaping="yes">var strQuery =
"DOI(</xsl:text><xsl:value-of
select="./mets:dmdSec/mets:mdWrap[@OTHERMDTYPE='DIM']/mets:xmlData/dim:dim/dim:field[@element='identifier'
and @qualifier='doi']"/><xsl:text disable-output-escaping="yes">)";
var varSearchObj = new searchObj();
varSearchObj.setSearch(strQuery);
varSearchObj.setNumResults('1');
//launching search
try {
sciverse.runSearch(varSearchObj);
} catch(err) { }
};
runAfterJSImports.add(runSearch);
</xsl:text>
</script>
And then paste the code in *bold* where you want the scopus citation count
to appear. In our case, I put it under the citation field (I assumed that
you already knew how to customize what fields to display in simple item
view):
<!-- Citation row -->
<xsl:when test="$clause = 9 and
(dim:field[@element='identifier' and @qualifier='citation' and
descendant::text()])">
*<div id="citecounts-scopus" class="simple-item-view-other
citecounts hidden"> </div>*
Hoped this helps,
P.S. Please take note that I have created a custom tag, dc.identifier.doi
that holds the value for the item's DOI (without the http://dx.doi.org/).
Feel free to 'view page source' items in our repository that have DOIs for
example: http://repository.seafdec.org.ph/handle/10862/1737 for your
reference.
Regards,
Elvi
On Thu, Feb 13, 2014 at 9:07 PM, Solomon Kapfunde <[email protected]>wrote:
> Hi Elvi
>
> This is out of the discussion forum, I have copied the code as you say in
> the link but I can't get it to run as it give me errors on all hyerplink
> tags in the script as stated in the error below.
>
> When I add the code in item-view.xml, mirage theme, xmlui i get an error
> 'javax.xml.transform.TransformerException: a is not allowed in this
> position in the stylesheet!
>
> Can you help?
>
> Regards
> Solomon
>
> >>> "Nemiz, Elvi" <[email protected]> 2014/02/12 03:48 PM >>>
> Hello Solomon,
>
> Perhaps this thread might help you.
> http://dspace.2283337.n4.nabble.com/Scopus-Integration-Cited-By-Count-API-td4667632.html
> .
>
> Regards,
> Elvi
>
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette