Conditionals with match attribute in Zotero 2.1 csl

I am trying to manually fix a migrated citation style from Zotero 2.0 to 2.1 that contains the following macro:
<macro name="access">
<choose>
<if variable="URL accessed" match="all">
<date variable="accessed" prefix="viewed ">
<date-part name="day" form="numeric" suffix=" "/>
<date-part name="month" form="long" suffix=" "/>
<date-part name="year" form="long"/>
</date>
<text variable="URL" prefix=", &lt;" suffix="&gt;"/>
</if>
</choose>
</macro>
I noticed the "accessed" part is shown in Zotero 2.1.6 even if the URL is empty, which is wrong.

The following code works as expected:
<macro name="access">
<choose>
<if variable="URL">
<choose>
<if variable="accessed">
<date variable="accessed" prefix="viewed ">
<date-part name="day" form="numeric" suffix=" "/>
<date-part name="month" form="long" suffix=" "/>
<date-part name="year" form="long"/>
</date>
<text variable="URL" prefix=", &lt;" suffix="&gt;"/>
</if>
</choose>
</if>
</choose>
</macro>


Is this a bug or am I missing something?
  • That does look like a bug to me, yes - I'll do some testing and maybe Frank can have a look, too.
  • That macro (the first version you list) works fine in the processor. Omitting either "accessed" or "URL" in the input yields no output.
  • @Frank:
    1. Testing with Zotero 2.1.6
    2. There must be some side effect at play here because if I isolate the macro, the symptom is different - there is no output if both are non-empty. One way or the other, it seems like something to do with the match attribute.
  • Can you run the same tests with the branch XPI? There have been some changes to the code behind the match attributes since Zotero 2.1.6 was released, and I'd like to be sure the is an issue before building further tests and digging into the processor code.
  • Just tested with the dev xpi 2.1.6 r9406 and this looks fixed.
  • That's very good to know. Thanks for reporting back.
Sign In or Register to comment.