Validating new style, looking for guidance on fixing errors

Hi folks,

I've made some changes to an existing style to suit the journal Australian Archaeology. In terms of the style itself, I think I have it mostly correct now (the visual CSL editor is brilliant) and I wanted to validate the CSL so it can be added to the repository and shared via Github etc.

I have not done this before however I edited a CSL 1.0 style in the visual CSL editor, and when validating with http://simonster.github.io/csl-validator.js/ I get errors. Hence my query:

The first validation error I get is:


stdin:20:4: error: attribute ^field not allowed
required:
after
after

error: invalid input


I guess is this means that at line 20 there is an error, which is:


<category citation-format="author-date" field="anthropology"/>


I've looked up the CSL 1.01 guidelines and fields and values are correct (I managed to correct some other errors before getting to this point)

My questions:

- Is csl-validate.js the best validation tool for a newbie to use?
- what does the error mean?
- is there a guide to correcting validation errors? I'm sure there will be other errors and I don't want to bug the forum with these minor issues.

Many thanks
Mick.
  • Is csl-validate.js the best validation tool for a newbie to use?
    probably, yes.
    what does the error mean?
    category can only have one attribute. So what you want is
    <category citation-format="author-date"/>
    <category field="anthropology"/>
    is there a guide to correcting validation errors? I'm sure there will be other errors and I don't want to bug the forum with these minor issues.
    not really, no. Obviously you can check existing styles to spot differences and you can refer to the official specifications, http://citationstyles.org/downloads/specification.html but the validation errors are auto-generated and it'd be pretty hard to write a one-by-one manual that tells you what to fix.
    That all said, we don't at all mind CSL questions at all - in the end, more people understanding CSL benefits Zotero (and the wider CSL universe), so don't feel like you need to be reluctant to ask. In general you'd want to make the entire style code available (on gist.github.com or pastebin com - i.e. places where we can look at it without downloading anything), the validator may not always point directly to the relevant line.
  • Hi Adam, a silly error but thanks for response—it has validated nicely. I've submitted a pull request, hope I've done that correctly.

    Thanks again.
Sign In or Register to comment.