Problem with style after upgrading to 2.1.5

Hi, I recently updated to 2.1.5 and I have a problem with an homemade style I made. Before the update, everything was fine with this same style.

I can install my homemade style, but when I try to create a bibliography, or I try to cite it, I get an error. When I try to chrome://zotero/content/tools/csledit.xul, I get this error :

Error parsing style :
TypeError: token.strings is undefined

I tracked the changed I made to the style using GIT, and here are a diff between a working version and a non-working version (the - lines are from are from the functionning version, while the + lines are from the disfunctionning function).

<macro name="access">
<group>
- <text value="[En ligne]" suffix=" "/>
+ <text value="En ligne" suffix=" <"/>
<text variable="URL"/>
- <group prefix=". Consulté le " suffix="">
:
+ <group prefix=">. Consulté le " suffix=""
<text term="" text-case="" suffix=" "/>

Does anybody have any idea where would be the bug ?
  • I'll assume you're using & lt ; and & gt ; for < and > - else that would cause problems.
    Then:

    <group prefix=">. Consulté le " suffix=""
    <text term="" text-case="" suffix=" "/>

    that looks wrong. The <group needs a closing bracket:

    <group prefix=">. Consulté le">

    and you can't have an empty text term in the line
    <text term="" text case="" suffix=" "/>
    that looks like you can just delete it.
  • Hi,

    Using & lt ; and & lg ; seems to solve it. I'll continue to test with my other changes, but thanks for now !

    What I don't understand though, is why it did work before and stopped after the upgrade (I also upgraded to Firefox 4 then downgraded to 3.6)

    Note : About the closing bracket, it was a mistake in my copy-paste : I did have in my code.

    Thanks again
  • csl has changed for Zotero 2.1 - styles are getting auto-tranformed, but some details have changed (though I'm surprised this ever worked for you).
  • edited April 16, 2011
    Hi everyone,

    I have the same problem as the one of stephanecouture since I have updated firefox to 4th version.

    Unfortunately, I do not understand the solution of this problem "Using & lt ; and & lg ; seems to solve it.". Could you explain me how I can modify my own style in order to this works again ?

    My configuration :
    Zotero 2.1.6
    Word integration 3.1
    OpenOffice integration 3.5a1
    Word 2007
    Openoffice 3.2
  • Paste your style as a public gist, and post the URL from the address bar back to this thread.
  • Here it is:
    https://gist.github.com/923048
  • edited April 16, 2011
    There are three problems with the syntax, which are shown below.
    • In the first block, there is a second "name" element inside "names". There can only be one, so move the "and" attribute up to the legal "name" node and delete the extra one.
    • In the second block, there is an empty "else" node, which is illegal. It doesn't serve any useful purpose, so it can be deleted.
    • In the third block, the < and > characters are illegal inside an attribute, and should be replaced with the &​lt; and &​gt; strings, as discussed above.
    You can pick up a copy of the style file with these changes here.--- infiles/MyStyle.csl 2011-04-16 21:06:31.361571002 +0900
    +++ infiles/mystyle.csl 2011-04-16 21:06:16.641571002 +0900
    @@ -37,12 +37,12 @@
    <name initialize-with="."
    delimiter=", "
    delimiter-precedes-last="always"
    - name-as-sort-order="all"/>
    + name-as-sort-order="all"
    + and="text"/>
    <label form="short"
    prefix=" ("
    text-case="capitalize-first"
    suffix=".)"/>
    - <name and="text" delimiter=", "/>
    </names>
    </macro>

    @@ -53,9 +53,6 @@
    <date-part name="year"/>
    </date>
    </if>
    - <else>
    -
    - </else>
    </choose>
    </macro>

    @@ -148,8 +145,8 @@
    <else-if type="webpage">
    <group delimiter=" ">
    <text variable="URL"
    - prefix="<"
    - suffix=">." />
    + prefix="&amp;lt;"
    + suffix="&amp;gt;." />
    </group>
    </else-if>
  • It does perfectly work : thank you !
    Have a nice week-end !
  • edited April 27, 2011
    Have problems too ...

    It tells me that I have a problem with the undefined date-part ... can't seems to find it !

    Help please :)
    https://gist.github.com/945026
  • <date variable="issued"></date> isn't valid.
    you need at least one <date-part-name element in there, as in

    <date variable="issued">
    <date-part name="year"/>
    </date>

    (or delete the entire line 49)

    Also, your update date isn't in valid format - that might not break the style, but in order to validate I'd recommend just copying it from another style.
  • Thanks, it works :)
Sign In or Register to comment.