Version 4.0.5: variable "note" can't be tested
Hi,
the following IF-test doesn't work correctly with the new version 4.0.5:
Settings: only the variable "note" is empty (no entry)!! The test should go to ELSE...
<if variable="author note" match="all">
<text value="should not be this"/>
</if>
<else>
<text value="should be this!"/>
</else>
The test without other vaiables is correct:
<if variable="note">
<text value="With these settings, not this!"/>
</if>
<else>
<text value="It's this one!"/>
</else>
Ciao, Berni
the following IF-test doesn't work correctly with the new version 4.0.5:
Settings: only the variable "note" is empty (no entry)!! The test should go to ELSE...
<if variable="author note" match="all">
<text value="should not be this"/>
</if>
<else>
<text value="should be this!"/>
</else>
The test without other vaiables is correct:
<if variable="note">
<text value="With these settings, not this!"/>
</if>
<else>
<text value="It's this one!"/>
</else>
Ciao, Berni
Perhaps there is an error in the info-part (?), because you are right: when i installed the style, i got the hint like: the file is not a validate CSL 1.0.1 style and it could work uncorrectly (the error is in germsn-lang.) but with zotero 4.0.4 it worked correctly.
<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note">
<info>
<title>berni4</title>
<id>http://www.zotero.org/styles/berni4</id>
<author>
<name>Bernhard Preusche</name>
<email>BPreusche@gmx.de</email>
<uri>http://wherever.com/</uri>
</author>
<category citation-format="note"/>
<category field="theology"/>
<updated>2008-10-29T21:01:24+00:00</updated>
<summary>My great new style format.</summary>
<rights>Keine Rechte!</rights>
</info>
validates, both in the validator and when installing.
You need a citation element.
The problem is the matching bug, the validation works fine.
That test creates two functions, bundled as a list. The list of two items is passed into the "all" function that evaluates them -- which receives a list with only one item in it. There isn't any code between those two steps, which has me wondering whether this might be a bug in the Firefox JavaScript engine.
A test built with the style runs fine in the Rhino JavaScript engine that I use to test the processor. That also makes me suspect the Firefox JS engine as the culprit.
When I get this sorted out, this thread will be closed. :-)
Technical run-down: In new code, when the style is built I'm doing preemptive execution, to encapsulate the test. The problem is that the attributes are evaluated in @bpreuche's test in a different order in Rhino (the testing engine) and in Tracemonkey (the Firefox JS engine). That's the bug in the processor: once it's fixed, it will come right.
cu