ibid error when no page

I have integrated ibid in my style. It works very well.
Just in one case it produces a wrong output:
If i cite e.g. a book without a page number and i cite it again without a page number, the second citation looks like this:

ibid, p.
(instead of just "ibid.")

I have disabled "p" for page. All other ibid are without p
How could I fix this?

this is my citation code:
https://pastebin.com/RupudN96
  • I can't tell from the excerpt, but the first step would be to clean up & validate the code (e.g. the section all the way at the bottom appears to apply to all positions, ,which is weird. Moreover, you have an else-if without condition in l. 55, which is invalid.)
  • the section at the bottom adds the locator/page number to the citations.
    the last else-if adds the locator for everything if its not a case of ibid.
  • I understand what the section of that code does, but I don't understand why it's outside the else-if (should be: else) condition for the position -- that way it applies to ibid citations as well, which makes a mess of the style.

    And again, else-if without an if condition isn't valid CSL (use else for that). I'm happy to try to help you debug your CSL, but you need to get it to the point where it validates. https://validator.citationstyles.org/

  • It actually does validate this way.
    However, I changed lines 55, 57 to else.
    What else would you change? There are a lot of else-conditions. Which do you mean?
  • edited June 22, 2023
    <else-if> by itself is never valid -- it needs a condition (that's what makes it else-IF)

    Edit -- you can post your whole code to pastebin and I can look at the validation, but it also really won't validate with an empty else-if condition in it, I just tested
  • I uploaded the validated code here:
    https://pastebin.com/w1mwmT56
  • Perhaps it is identifiable from the code why "ibid, p." (or localized "Ebd, S.") occours when a book is cited twice without a page number.
  • Right, you're adding the locator code twice for ibid citations. Both when you create them and again in row 203-216.
    Basically you'll want to start <else> in row 98 (and then need to start with <if> in row 100) and then end with </else></choose> after row 217 (not in 201 where you had this originally). You'll want to clean up the 203-216 section which doesn't make a lot of sense right now and you'll probably need to do some diligence to make sure that the choose conditions line up. Getting indenting right using formatter.citationstyles.org/ will help with that.

  • Line 100: Element “if” from namespace “http://purl.org/net/xbiblio/csl” not allowed as child of element “else” from namespace “http://purl.org/net/xbiblio/csl” in this context. ?
  • you'll need to put a choose around that entire block from if on l. 100 through the /else that's on l. 201 of the version linked above
  • That gives me 10 other errors.
    https://pastebin.com/PNAZBBPw
  • Sorry, I can't help at that level of detail.
    You'd need to figure out how to set choose/if/else-if/else conditions correctly (in the sense of both valid CSL and sensible conditionals).
    To recap, the basic logic you want is

    if position="ibid-with-locator"
    else-if position = "ibid"
    else
    ---> and then a whole set of if/else-if/else for the different item types within that last else, which captures all 'regular' citations.

Sign In or Register to comment.