else and else-if not working

Hi all

I'm having trouble getting else and else-if arguments (right term?) to work. For example, in the code below, the if argument is working fine - if there's a volume number in the library entry, it implements; but the else argument isn't - if there's no volume number it doesn't produce "Why not?"

Why not?

Thanks for all tips. I'm sure it's something very basic that I've missed, but it's happening a lot and getting frustrating.













  • You'd need to wrap that code in "code" wrappers or if it's a whole style better to put it on hastebin or pastebin and share the link.

  • Does this work?


    <choose>
    <if variable="volume" match="any">
    <text macro="date" prefix=" (" suffix=")" />
    </if>
    <else>
    <text term="Why not?" />
    </else>
    </choose>

  • You want to use <text value="xyz"/> if you want to just write random text. Terms are specifically defined entities (pretty sure the above would also have thrown an error on validation -- always make sure your CSL validates, otherwise there's a good chance you'll see weird things)
  • Ah, so that was it!

    Thanks.

    Caspar
Sign In or Register to comment.