Self made citation style sorts on index number while defined as author-date

Hi,
I have made a CSL file and almost everything is working. There is just one small mystery that I haven't been able to solve. My CSL style refuses to sort on author / date, it sorts on index number while I did not configure it like that. My bibliography tag contains:
<sort>
<key macro="author"/>
<key macro="year-date"/>
</sort>

the header has this tag: <category term="author-date"/>
and author is defined as:
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="text" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
</names>
</macro>

and year-date as:
<macro name="year-date">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</if>
<else>
<text term="no date"/>
</else>
</choose>
</macro>

i am sure it's something simple, your help is much appreciated!
best regards,
Diederik
  • Would help to see the whole file. Can you post it somewhere?
  • Like here: http://tinypaste.com/
    That makes it easier than to paste it to the forum.
  • I have posted the file at http://tinypaste.com/08246b9
    thanks for you help.
  • Sigh.

    OK, first big problem is that your file is not valid; there are dozens of errors. Fix those problems and you might find it magically works as you expect.
  • Some info to get you going:
    http://www.zotero.org/support/dev/creating_citation_styles

    My XML validator (RNV) gives about 30 errors, one of which is that you put the sort-instructions inside the layout of the bibliography. Still, as bdarcus said, fixing that still leaves you with a crippled style that won't work reliably unless all the other errors have been fixed.
  • Would be nice if Zotero could reject invalid styles.
  • Thanks a lot! I only used the online style generator and made some changes and i hadn't expect this, but thanks for pointing me in the right direction. i will solve those errors.
  • Do you still have the original style as created by the generator (and if so, can you put it up via tinypaste again)? I would like to know whether the generator created some of those errors.
  • Hi Rintz,

    Most errors were because the online generator added form="", I removed those and the sort was at the wrong spot, I fixed that and now it works. There were also some errors because of variable names, but I am not sure why that would throw an error. For example, the validation scheme chokes on:
    <option name="disambiguate-add-year" value="true"/>
    <option name="disambiguate-add-givename" value="true"/>
    but I have seen these options in many reference styles.

    I don't have the original csl file as generated.....

    thanks for your help!
  • edited March 4, 2009
    The option "disambiguate-add-year" doesn't exist in CSL. Perhaps you wanted to specify "disambiguate-add-year-suffix"? As for "disambiguate-add-givename", that's got a typo in it (missing a 'n' in 'give*n*ame').

    See also:
    http://www.zotero.org/support/dev/csl_syntax_summary#citation_only_options

    I'll guess the author of the generator will also have to be notified of some problems with producing valid styles.
  • THANKS! my csl file validates nicely!
Sign In or Register to comment.