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
  • Both tests work correctly in the current release of the processor. Is your test style valid CSL?
  • works correctly for me. We need to see this in context.
  • Here is a gist of my style. https://gist.github.com/anonymous/5407554

    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.
  • I can confirm that with the simplified style. (It doesn't validate because you can't have a space in the id - it validates with http://www.zotero.org/styles/berni4 ). This has nothing to do with note but seems to be a problem with match="all" in that setting. e.g. "author abstract" also evaluates to true even when the abstract is empty.
  • besides the match-error above, the validation-error occurs again without space in the ID:

    <?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>
  • https://gist.github.com/adam3smith/5407923
    validates, both in the validator and when installing.
    You need a citation element.

    The problem is the matching bug, the validation works fine.
  • I've tracked down the bug. It may not be my doing.

    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.
  • If someone has Firefox 17 installed, I'd be curious what the style does in that environment. My tests were done with Firefox 20.
  • Okay, I'm pretty well convinced that this is due to a bug in the Firefox JS interpreter. I've found a workaround, though, that will produce correct output in the case, and will release the new code a little later in the day.
  • Hold that thought! My apologies for the string of premature notes above. I believe that I do own this bug.

    When I get this sorted out, this thread will be closed. :-)
  • edited April 18, 2013
    Finally got my head around this.

    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.
  • Fixed. You can test the revisions by installing the processor patch plugin.
  • Thanks a lot, now it works.
    cu
Sign In or Register to comment.