I have a problem with Aleph

Zotero recognizes Aleph, but has an error message when I try to translate it. I am working with an Israeli version of Aleph, for example of the Hebrew University, here: http://aleph518.huji.ac.il/F.

I'll appreciate help here,

Thank you.
  • Here's a patch to fix the problem with all Israeli universities (or at least every one that I checked). Please put it into the repository if it doesn't break anything:

    p.s.
    It seems to me like the variable nonstandard and all references to it can be safely removed, but I didn't want to touch them.


    --- old_aleph.js 2009-05-01 19:56:34.000000000 +0300
    +++ new_aleph.js 2009-05-13 08:42:11.476875000 +0300
    @@ -80,9 +80,13 @@
    if (prefix == 'x') return namespace; else return null;
    } : null;
    var nonstandard = false;
    + var th = false;
    var xpath;
    if (newDoc.evaluate('//*[tr[td/text()="LDR"]]/tr[td[2]]', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
    xpath = '//*[tr[td/text()="LDR"]]/tr[td[2]]';
    + } else if (newDoc.evaluate('//*[tr[th/text()="LDR"]]/tr[td[1]]', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
    + xpath = '//*[tr[th/text()="LDR"]]/tr[td[1]]';
    + th = true;
    } else if (newDoc.evaluate('//tr[2]//table[2]//tr', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
    xpath = '//tr[2]//table[2]//tr[td[2]]';
    nonstandard = true;
    @@ -97,14 +101,18 @@
    var elmt;
    var record = new marc.record();
    while(elmt = elmts.iterateNext()) {
    - if (nonstandard) {
    - var field = Zotero.Utilities.superCleanString(newDoc.evaluate('./td[1]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
    - } else {
    - var field = Zotero.Utilities.superCleanString(newDoc.evaluate('./TD[1]/text()[1]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue);
    - }
    - var field = Zotero.Utilities.superCleanString(newDoc.evaluate('./td[1]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
    + if (th) {
    + var field = Zotero.Utilities.superCleanString(newDoc.evaluate('./th', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
    + } else {
    + var field = Zotero.Utilities.superCleanString(newDoc.evaluate('./td[1]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
    + }
    if(field) {
    - var value = newDoc.evaluate('./TD[2]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; //.split(/\n/)[1];
    + var value;
    + if (th) {
    + value = newDoc.evaluate('./TD[1]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; //.split(/\n/)[1];
    + } else {
    + value = newDoc.evaluate('./TD[2]', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; //.split(/\n/)[1];
    + }
    if (value.split(/\n/)[1]) value = Zotero.Utilities.trimInternal(value.split(/\n/)[1]);
    Zotero.debug(field + " : " + value);
    if(field == "LDR") {
  • Hello
    can someone tell me how to add this patch ?

    Aleph drives me crazy... :-)

    Thanks
  • It would be easier for you to just replace the translator file. Here's the entire patched file:
    http://pastebin.com/m51174fbe

    The steps you'll need to do (for Zotero 1.5/2.0):
    1. Download it and save it somewhere as "Library Catalog (Aleph).js"
    2. Locate your data directory (Zotero Prefrences -> Advanced -> Show Data Directory)
    3. Replace the aleph file there with the new one.
    4. Restart Firefox and pray. :)

    In case it doesn't work, you might need to replace the translator file source which is stored as an obscured nnn.js inside a ZIP file in the Zotero extension folder.

    In my case it's in:
    {Firefox profile dir}\extensions\zotero@chnm.gmu.edu\translator.zip
    And Aleph is 151.js (but it used to be 146.js just a few days ago... :/)

    Another thing: I think the translator gets deleted every time Zotero updates their translators (which is very often), so the best solution is to just wait until my patch gets incorporated. :)
  • I use zotero 1.10
    I tried 1.5 but I had problems with the word plugin (didn't work....I use hebrew word and the plugin works with zotero 1.10)

    sems that I'll have to wait as your last recomendation ....
  • well I upgraded to zotero 2.04
    and did what you saud...

    didn't work ...

    aleph is still a problem
  • Sorry for the late response.

    I tested the translators again, and they work (well, I tested with TAU, HUJI catalog is down right now).
    I can't think of any other way to help you than this:

    Try replacing your translator.zip file with this one:
    http://www.mediafire.com/?bxewclc41cl

    (It might not work once Zotero is updated again)

    I really hope the developers will integrate this patch, but they're probably too busy to test it now.
  • all the links are not working anymore. do you know when the patch would get accepted into the code?
  • I wish I knew. I can't see why the devs haven't integrated it, but they might be busy with clearing the beta without introducing new code. Kinda bad for us, since for us it's a bug, not a feature... I also have to reapply the patch every update.

    Anyway, here it goes to pastebin again:
    http://pastebin.com/f6f83a64a

    You'll have to know how to apply the patch though.
  • it's OK now....
Sign In or Register to comment.