"Position" returning true when should be false.

If I call the following macro from inside the <bibliography> element, I had expected that nothing would be printed, because the CSL specs say that "position" returns false when tested against any of the given positions.

<macro name="author">
<choose>
<if position="first" >
<names variable="author" >
<name and="symbol" />
<substitute>
<text macro="editor" />
</substitute>
</names>
</if>
</choose>
</macro>

Am I doing something wrong?
  • The macro you have posted will print the first time the item is encountered, and will not print for later references. position="first" is true the first time the item is used.
  • The specification states that position "...[t]ests whether the position of the item cite matches the given positions (when called within cs:bibliography, this condition will always test "false")"

    Let me be more explicit about what I am trying to do:
    ...
    <macro name="author">
    <choose>
    <if position="first ibid ibid-with-locator subsequent" match="any" >
    <text value="citation" />
    </if>
    <else>
    <text value="biblio" />
    </else>
    </choose>
    </macro>
    ...
    <citation>
    <layout>
    <text macro="author" />
    </layout>
    </citation>
    <bibliography>
    <layout>
    <text macro="author" />
    </layout>
    </bibliography>
  • It may be that either the specification or the CSL processor should be adjusted, so that the two are aligned, we'll look at this. In your code, though, why not just define two separate macros, one to be used in cs:citation, and another to be used in cs:bibliography?
  • Thanks for your quick response to this.

    I had it as two macros, and I am going to change it back, at least for the moment.

    I was just hoping to streamline things a bit, but two macros isn't the end of the world; as much as anything, I thought it would be useful to bring this to your attention.

    Thanks again!
  • I set up a test case based on your example, and found that my code was not recognizing multiple parameters to the position= argument. The schema does allow that, and I'm working on a fix. I'll also fix things up so that the processor conforms to the specification in returning false inside the cs:bibliography node. May be a few days before it goes live, but on the way.
  • Frank - would this have been implemented in the latest 2.1 beta? Sorry for being so pushy. Perhaps I should learn how to check these issues myself...
  • check the install page for the beta - it went up November 9 - so the answer is no.
  • It's been fixed in the current release of the processor, and should come through in beta 3.
Sign In or Register to comment.