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:
The following code works as expected:
Is this a bug or am I missing something?
<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=", <" suffix=">"/>
</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=", <" suffix=">"/>
</if>
</choose>
</if>
</choose>
</macro>
Is this a bug or am I missing something?
This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
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.