Locators Zotero 2.1.6

Having to use locators that are not in Zotero (previous posts), since I don't need "sub verbo", I added a test so as to ignore it and enter the label and the locator itself in the dedicated field.

1/ CSL 0.8 didn't accept sub verbo, nor does CSL 1.0, as the valdator says :
Error: Bad value sub verbo for attribute locator on element if from namespace http://purl.org/net/xbiblio/csl.

From line 545, column 5; to line 545, column 28

<if locator="sub verbo">

2/ So as in Zotero 2.0. I tested all the other locators, as follow:
<macro name="locator-refs">
<choose>
<if locator="book chapter column figure folio issue line note opus page paragraph part section verse volume" match="none">
<text variable="locator" prefix=", "/>
</if>
<else>
<label variable="locator" form="short" prefix=", "/>
<text variable="locator" prefix=" "/>
</else>
</choose>
</macro>

But in Zotero 2.1.6 whatever is the locator, the label never appears. I changed the test with "any", or just with "page", but it looks as if testing the locator makes it ignore the rest of the macro.

Thanks for your help
  • edited April 27, 2011
    I don't know why this doesn't validate - "sub verbo" is definitely defined in the schema, my suspicion would be the space.
    https://github.com/citation-style-language/schema/blob/master/csl-terms.rnc
    In any case, for me at least testing for sub verbo still works. You'll likely have to author your style in csl 1.0 so that conversion doesn't fail but otherwise I see no reason why you shouldn't use that.
    I tested <choose>
    <if locator="sub verbo">
    <text value="test"/>
    </if>
    </choose>

    and that worked fine.
  • edited April 27, 2011
    Might have something to do with encodings and interaction with your validator?

    It might also make sense to consider changing "sub verbo" to "sub-verbo". Any objections to that?
  • I tested with emacs nxml mode and typed the code myself - that tends to be quite robust.

    I think changing to sub-verbo would be good, yes.
  • So it's a bug. The locator conditional is defined as a (space-separated) list. Hence, the validator sees those as two values: "sub" and "verbo".
  • edited April 27, 2011
    @l2lafitte: do I understand correctly that you are just trying to suppress the "sub verbo" label? An alternative way to do that is to redefine the "sub verbo" terms as empty strings, e.g. (in CSL 1.0):

    <locale>
    <terms>
    <term name="sub verbo">
    <single></single>
    <multiple></multiple>
    </term>
    </terms>
    </locale>


    That way you wouldn't need a conditional.
  • I've built a processor test based on the workaround posted by the OP, and I can confirm that citeproc-js fails as per the description. However the CSL argument is split by the processor, the first branch should render if none of "sub verbo" nor "sub" nor "verbo" matches the locator label.

    Apparently the processor is treating the argument to the locator attribute on conditional statements as a single token; it does work correctly if only one locator type is specified. I'll fix this in the processor, and the fix should appear in the next Zotero version.

    Meanwhile, Rintze' simple suggestion to just redefine the sub verbo term as empty is worth a look; that should work just fine.
  • This turned out to be a very useful exercise, as it turned up bugs in the core condition evaluation code that (quite surprisingly, and much to my chagrin) were not picked up by the test suite. The code posted by l2lafitte will work in the next release. A straight test of "sub verbo", either as a lone term name, or as one of the terms in a list, will also work.
  • 1/ The @Rintze proposal was very interesting,
    but unfortunately, although the validator admits it, it doesn't have any effect.

    If I choose "sub verbo" in the Zotero panel I get the label "s. vv." (without quotes)

    2/ I made another test, as follows :

    <macro name="locator-refs">
    <choose>
    <if locator="book chapter column figure folio issue line note opus page paragraph part section verse volume" match="any">
    <text value="BRANCHE1"/>
    <label variable="locator" form="short" prefix=", "/>
    <text variable="locator" prefix=" "/>
    </if>
    <else>
    <text value="BRANCHE2"/>
    <text variable="locator" prefix=", "/>
    </else>
    </choose>
    </macro>

    Whatever locator I choose, I obtain BRANCHE2 and no label

    Replacing match "any" by match "none", I then always obtain BRANCHE1 followed by the locator label ( "s. vv." included)

    Very strange
  • edited April 28, 2011
    Yes, the conditional logic in the current processor version breaks when more than one locator is specified -- it's a clear bug, which will be fixed in the next release. As an extra, I've also fixed things so that you can test for "sub verbo" directly, without testing for everything else instead. It's just broken, there's not much you can do until the revised processor is available in a release.

    Re Rintze' proposal, be sure that the term is aligned with the CSL version (CSL 1.0 uses the structure in the example, CSL 0.8.1 was a bit different). I'm pretty sure that I tested for empty terms. If it's definitely not working, paste the style to http://gist.github.com/ as a public gist and post the URL from the address bar back here; I'll be happy to take a look and test it locally.
  • edited April 28, 2011
    In fact, Rintze' proposal works perfectly, I just had to add: form="short"

    <term name="sub verbo" form="short">
    <single></single>
    <multiple></multiple>
    </term>

    The result is exactly what I need.
    Furthermore, it's much simpler.

    Excuse me for giving a incomplete information.
  • 1/ I now updated to 2.1.7, using the amended Rintze' proposal.
    The locator's label is then omitted in the citation, and to that point, it's fine.

    However, there is a special problem with sub verbo:

    Once we have entered a note containing "sub verbo" as a locator, next time we want to modify it, the locator field is blank. If one doesn't pay attention, this blank information will be transformed to "page" the next time !

    I tried it with Chicago full note and obtained the same result as with my own style

    It's quite dangerous to leave it as it is.

    We hope a solution will soon be found.

    2/ I saw on other threads that some people ask for more locator types. Since we have this kind of problem I understand their request.

    But I again plead for an "joker" type, with no label attached that would allow everybody to use it as his own field requests

    http://forums.zotero.org/discussion/14717/universal-locator-type/
  • This glitch with sub verbo is from my desk, unfortunately. I recognized the cause immediately on seeing your note, and just issued a fix. You should see this odd behavior go away with the next release.
  • I suppose this is not in 2.1.8.r9431 which I tested without any success.

    Do you mean it would be in 2.1.8 ?
  • no - you can check on trac when Simon or Dan update to the next citeproc version:
    https://www.zotero.org/trac/timeline
    which I guess will be 1.0.178
  • Here I am again with the sub verbo question.

    I am unable to find out if it was supposed to be operational.

    I will describe how it works with the 2.1.8 (I tried the 2.1.8.r10027 which crashes):

    If we enter sub verbo in a citation, the result is OK, but if we want to modify it, we discover that the locator label has been erased in the Zotero panel, and, more serious, it has been considered as "page". If we look at it again in the Zotero panel, the label is now "page", there is no trace of the initial label, that is "sub verbo"

    But if we cite exactly the same reference, with the same location (we then obtain "Ibid"), and we want to modify it, we discover that "sub verbo" has been left. But,of course, if we modify it, "sub verbo" disappears as in the case before.

    With which stable release can we hope to get this question solved ?

    Thanks
  • Thanks for reporting. I'll take a look soon. The official CSL position is that "sub verbo" is simply not allowed in the current version of the schema. I believe that I have worked around the limitation in the processor, but I will check with the latest processor version and the Zotero trunk.

    I'll report back on what I find after I've had a chance to take a look. Feel free to ping this thread if you don't hear back in a day or two.
  • The official CSL position is that "sub verbo" is simply not allowed in the current version of the schema.
    That's not correct, although there is a problem with using "sub verbo" in conditionals. See http://sourceforge.net/mailarchive/message.php?msg_id=27419940
  • I stand corrected.
  • I'm not sure if this is the correct place to ask this question, but I had just finished entering each locator with each term, when I saw the use of "label" instead of "term". So my question would be in which case would I use label and which case would I use term? I can't quite see the difference.
  • This brings up another question, are there any cases where the variable "locator" would be used in the bibliography, as opposed to in the inline citation?
  • 1. From the specs: to be used with a label, a variable "must be set to “locator”, “page”, or one of the number variables." In those cases, you should always use label over term (because it's context sensitive).

    2. No, no locators in the bibliography (they always refer to an individual citation of an item, not the item itself)
  • Thank you very much adamsmith. I replaced my long list of locators with terms with a variation of the one posted by l2lafitte.
  • I tested using a label with editorial-director and a term with editorial-director and they seem to give the same result. Not sure if it's better to use label or term in this type of instance.
  • for names, always use label, never use terms (the abbreviated form -- dir. -- in the French locale is the same in singular and plural, but it wouldn't necessarily be in other locales)
  • OK, great, thanks. I'll change my terms to labels for names.
Sign In or Register to comment.