Need help to find a mistake/loop

Hi!

I've already scripted 2 Styles successfully, but my lack of true scripting ability led me to adapt a style which just does not do anything...

1- It is a valid style, oXygen finds no mistakes in it.
2- I can "add" it properly to the list of style in Zotero proprieties.
However,
3- When I go on chrome://zotero/content/tools/cslpreview.xul
-Nothing shows up, and when I go to the editor, all styles work, except my new one which does not do anything.

I must have done a mistake somewhere... a loop (?), or something really silly.
As I've been working on it whole day, I just cannot read it anymore.
So if someone could have a look over it, it would save my day.

I can send the file by e-mail right away, just answer to this post and write to
philippe DOT tousignant AT gmail DOT com

Edit : On request, I put this link: https://gist.github.com/801412
(Thanks!)

Philippe

P.S. Last time it happens, I had save it as .csl, in ANSI, but now it's UTF-8, and still does not seem to be "active".
  • Just post it somewhere and provide a link. People here generally don't do e-mail-based support.
  • Well, thanks for the hint. ^_^

    There you go:

    https://gist.github.com/801412
  • It's not a valid CSL 0.8.1 style (validation output generated with validator.nu, as described at http://www.zotero.org/support/dev/creating_citation_styles#validation ):

    https://gist.github.com/801450
  • edited January 28, 2011
    The style is valid XML, but it calls macros that are not defined in the style. Here are a couple of listings that might be helpful in tracking down the problems. First, a list of the macro definitions, with line numbers (note that some macros are defined twice):
    555: article-journal
    516: article-magazine
    481: article-newspaper
    215: authority
    419: bill
    451: book
    571: case
    382: chapter
    185: collection-number
    181: collection-title
    312: container-contributors
    274: container-contributors-note
    82: contributors
    42: contributors-note
    123: contributors-short
    148: contributors-sort
    177: DOI
    93: editor
    53: editor-note
    235: editor-translator
    207: genre
    141: interviewer
    75: interviewer-note
    169: issue
    219: issue
    223: issued
    201: issued-year
    539: note-article-journal
    493: note-article-magazine
    469: note-article-newspaper
    434: note-book
    367: note-chapter
    397: note-thesis
    193: number-of-volume
    197: page
    211: page
    651: point-locators
    622: point-locators-subsequent
    161: publisher
    165: publisher-place
    107: recipient
    68: recipient-note
    134: recipient-short
    287: secondary-contributors
    266: secondary-contributors-note
    231: short-title
    693: sort-key
    408: thesis
    352: title-chapter-special
    100: translator
    61: translator-note
    173: URL
    189: volume

    Second, a list of macros called from the cs:citation and cs:bibliography sections (all of these calls need to have a corresponding macro definition):
    849: access
    777: access-note
    829: article-journal
    825: article-magazine
    821: article-newspaper
    582: authority
    730: bill
    801: bill
    813: book
    746: case
    817: case
    809: chapter
    443: collection-number
    460: collection-number
    442: collection-title
    459: collection-title
    773: collection-title
    845: collection-title
    387: container-contributors
    839: container-contributors
    372: container-contributors-note
    768: container-contributors-note
    840: container-title
    769: container-title-note
    384: contributors
    410: contributors
    426: contributors
    453: contributors
    483: contributors
    495: contributors
    518: contributors
    557: contributors
    609: contributors
    833: contributors
    369: contributors-note
    399: contributors-note
    436: contributors-note
    471: contributors-note
    541: contributors-note
    763: contributors-note
    723: contributors-short
    694: contributors-sort
    836: description
    765: description-note
    374: edition
    389: edition
    438: edition
    455: edition
    86: editor
    46: editor-note
    269: editor-translator
    282: editor-translator
    401: genre
    412: genre
    595: issue
    601: issue
    846: issue
    575: issued
    579: issued
    377: issued-year
    392: issued-year
    403: issued-year
    414: issued-year
    428: issued-year
    446: issued-year
    463: issued-year
    475: issued-year
    487: issued-year
    510: issued-year
    533: issued-year
    543: issued-year
    559: issued-year
    774: issue-note
    424: legislativeBody
    844: locators
    841: locators-chapter
    848: locators-journal
    775: locators-newspaper
    847: locators-newspaper
    772: locators-note
    427: note
    758: note-article-journal
    754: note-article-magazine
    750: note-article-newspaper
    742: note-book
    738: note-chapter
    734: note-thesis
    421: number
    441: number-of-volumes
    458: number-of-volumes
    448: page
    465: page
    606: page
    654: pages
    379: point-locators
    394: point-locators
    429: point-locators
    466: point-locators
    477: point-locators
    489: point-locators
    512: point-locators
    535: point-locators
    551: point-locators
    567: point-locators
    607: point-locators
    776: point-locators
    713: point-locators-subsequent
    725: point-locators-subsequent
    376: publisher
    391: publisher
    402: publisher
    413: publisher
    425: publisher
    445: publisher
    462: publisher
    375: publisher-place
    390: publisher-place
    444: publisher-place
    461: publisher-place
    474: publisher-place
    486: publisher-place
    90: recipient
    120: recipient-note
    50: recipient-note
    131: recipient-short
    430: references
    386: secondary-contributors
    837: secondary-contributors
    371: secondary-contributors-note
    766: secondary-contributors-note
    423: session
    610: short-title
    794: sort-key
    805: thesis
    385: title
    400: title
    411: title
    422: title
    437: title
    454: title
    472: title
    484: title
    496: title
    519: title
    542: title
    558: title
    572: title
    835: title
    370: title-chapter-special
    764: title-note
    724: title-short
    456: translator
    87: translator
    439: translator-note
    47: translator-note
    440: volume
    457: volume
    594: volume
    600: volume

    Hope it helps. :)
    Frank
  • Okay, no idea how you did that soooo quickly... but thanks! I'll work on this and come back as soon as I have it done.

    Thanks both for your help again.

    Philippe
  • All problems solve!

    ...and now you may all applause haha.

    I've been able to turn Case Law in 9 different formating depending on the court. ^_^
  • Nice! I'll be working on a style for Masters theses in our faculty over the next few months. Our students hail from 10 or more jurisdictions, with legal systems that are all over the map. I'll look forward to looking at how you've handled things. Eventually, we'll want to find orderly ways of handling the subtle adjustments needed for legal materials across courts and jurisdictions. (The first task, of course, will be to convince the rest of the community that it really is necessary. :)
  • Yeah, convincing...!

    Thanks hehe. Well, I'm in mater in International Law... so... kinda my kind of field too. =)

    I can share files with you anytime, just say.
    I'll have a short "Guide" with it.
    You may have a look at this topic to see the result with a bit more of explainnation, I just posted it 1 minute ago.
    http://forums.zotero.org/discussion/9489/style-request-canadian-uniform-legal-citation-mcgill-guide/#Item_21
  • Frank - would you share the unix commands you use to check the macros? I want to be able to do that!
  • I threw away the file, so I'm not able to test these, but it was still in the terminal readline, so this should be right.

    For the first one (macro definitions), I think it was this:grep -n '\<macro name=' MCRJ7CSL08.csl \
    | sed -e 's/\([0-9]\+:\)[[:space:]]*/\1 /' \
    | sed -e 's/^\([0-9]\+: \)<macro name=\"/\1/;s/\".*//' \
    | sort --key=2

    For the second one (macro calls):grep -n "macro=" MCRJ7CSL08.csl \
    | sed -e 's/\([0-9]\+:\)[[:space:]]\+/\1 /' \
    | sed -e 's/\([0-9]\+: \).*macro=\"\([^"]*\).*/\1\2/' \
    | sort --key=2

    The [[:space:]] identifier for space-like characters is specific to GNU sed (it's the one shipped with most Linux systems these days, I think, but just in case).
Sign In or Register to comment.