TypeError:CSL.Attributes [attrname]未定义

时间:2018-10-12 16:16:16

标签: javascript xml mendeley csl

我对某种引用样式语言有点不满意。 Zotero最近更新,并且更正了导致的错误(CSL已更新为1.0.1版)并在CSL Validator中获得了绿灯后,我收到了Zotero错误:TypeError:CSL.Attributes [attrname]未定义

有人会解决吗?

尝试报告错误时,出现[JavaScript错误:“ CSL.Attributes [attrname]未定义” {文件:“ chrome://zotero/content/xpcom/citeproc.js”行:2778}]

这是代码(名称已被编辑为X,但未涉及其他内容)

<?xml version="1.0"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note" xmlns:lang="sp">
  <info>
    <title>X</title>
    <author>
      <name>X Y</name>
      <email>X.Y@noos.fr</email>
    </author>
    <id>C:/Users/X/Documents/CSL/X_final.csl</id>
    <category field="law"/>
    <category field="science"/>
    <updated>2010-06-28T21:01:24+00:00</updated>
  </info>

    <macro name="arret">
        <text variable="title" suffix=" "/>
    <date variable="issued">
            <date-part name="day" suffix=" "/>
      <date-part name="month" suffix=" " text-case="lowercase"/>
      <date-part name="year" suffix=", "/>
    </date>
        <text variable="container-title"/>
    </macro>

    <macro name="editor-translator">
    <names variable="editor translator" delimiter=", ">
        <label form="verb"/>
        <name and="text" delimiter=", " prefix=" " delimiter-precedes-last="never"/>
    </names>
  </macro>

  <macro name="author">
    <choose>
    <if type="legal_case">
<names variable="author">
<name name-as-sort-order="all" form="long" delimiter=", " and="text"
initialize-with="." delimiter-precedes-last="never" sort-separator=" "
font-variant="normal"/>
<label form="short" prefix=" (" suffix=".)"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
  </if>
</choose>
</macro>


    <macro name="author-bibliography">
    <choose>
      <if type="legal_case">
<names variable="author">
<name name-as-sort-order="all" form="long" delimiter=", " and="text"
initialize-with="." delimiter-precedes-last="never" sort-separator="  "
font-variant="normal"/>
<label form="short" prefix=" (" suffix=".)"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</if>
</choose>
</macro>


  <macro name="access">
    <group>
        <text term="accessed" suffix=" "/>
        <date variable="accessed" suffix=", ">
        <date-part name="day" suffix=" "/>
        <date-part name="month" suffix=" " text-case="lowercase"/>
        <date-part name="year"/>
      </date>
        <group>
                <text term="at" suffix=" "/>
            <text variable="URL"/>
        </group>
    </group>
  </macro>

  <macro name="title">
    <choose>
        <if type="book">
        <text variable="title" text-case="capitalize-first" font-style="italic"/>
      </if>
      <else>
        <text variable="title" text-case="capitalize-first" prefix="« " suffix=" »"/>
      </else>
    </choose>
  </macro>

  <macro name="title-short">
    <choose>
      <if type="book">
        <text variable="title" text-case="capitalize-first" font-style="italic" suffix=", op. cit." form="short"/>
      </if>
      <else>
        <text variable="title" text-case="capitalize-first" prefix="&#x201C;" suffix="&#x201D;, op. cit." form="short"/>
      </else>
    </choose>
  </macro>

  <macro name="publisher">
    <group delimiter=", ">
        <text variable="publisher-place"/>
      <text variable="publisher"/>
    </group>
  </macro>

  <citation et-al-min="6" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" collapse="year">
    <sort>
      <key variable="issued"/>
      <key macro="author"/>
    </sort>
    <layout suffix="" delimiter="; ">
      <choose>
        <if position="first">
          <choose>
            <if type="legal_case">
            <text macro="arret"/>
            </if>
            <else-if type="book">
              <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <group delimiter=" ">
                  <text macro="title"/>
                </group>
                <group delimiter=" ">
                  <text term="volume" form="short" text-case="lowercase"/>
                  <text variable="volume"/>
                </group>
                <text variable="edition"/>
                <text macro="publisher"/>
                                <text variable="collection-title" prefix=" coll. «" suffix="»"/>
                <date variable="issued">
                  <date-part name="year"/>
                </date>
                <group>
                  <label variable="locator" form="short"/>
                  <text variable="locator" prefix=" "/>
                </group>
                <text macro="access"/>
              </group>
            </else-if>
            <else-if type="chapter">
                            <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <text macro="title"/>
                <group delimiter=" ">
                  <text term="in"/>
                  <names variable="editor translator" suffix=" (dir.)" delimiter=", ">
                    <name sort-separator=", "/>
                  </names>
                  <text variable="container-title" font-style="italic"/>
                </group>
                <group delimiter=" ">
                  <text term="volume" form="short" text-case="lowercase"/>
                  <text variable="volume"/>
                </group>
                <text variable="edition"/>
                <text macro="publisher"/>
                <group>
                  <date variable="issued">
                    <date-part name="year"/>
                  </date>
                  <text variable="collection-title" prefix=" coll. «" suffix="»"/>
                </group>
                                <group>
                            <text variable="page"  prefix="p. "/>
                    </group>
                  <group>
                    <label variable="locator"  form="short"/>
                    <text variable="locator" prefix=" "/>
                  </group>
                <text macro="access"/>
                </group>
            </else-if>
            <else-if type="article">
              <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <text macro="title"/>
                <text variable="container-title" font-style="italic"/>
                <group delimiter=" ">
                  <text term="volume" form="short"  text-case="lowercase"/>
                  <text variable="volume"/>
                </group>
                <text variable="issue"/>
                <date variable="issued">
                  <date-part name="year"/>
                </date>
                <text macro="editor-translator"/>
                <text variable="edition"/>
                <group delimiter=" ">
                  <text macro="publisher"/>
                  <text variable="collection-title" prefix=" coll. «" suffix="»"/>
                </group>
                <group>
                  <label variable="locator"  form="short"/>
                  <text variable="locator" prefix=" "/>
                                    <group>
                        <text variable="page"  prefix="p. "/>
                        </group>
                    <text macro="access"/>
                                </group>
              </group>
            </else-if>
            <else>
              <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <text macro="title"/>
                <text macro="editor-translator" font-variant="normal"/>
                <group delimiter=", ">
                  <text variable="container-title" font-style="italic"/>
                  <group delimiter=" ">
                    <text term="volume" form="short"  text-case="lowercase"/>
                    <text variable="volume"/>
                  </group>
                  <text variable="issue"/>
                </group>
                <group>
                  <label variable="locator"  form="short"/>
                  <text variable="locator" prefix=" "/>
                </group>
              </group>
            </else>
          </choose>
        </if>
        <else-if position="ibid-with-locator">
          <group delimiter=", ">
            <text term="ibid" form="long" font-style="italic" text-case="capitalize-first"/>
            <group>
              <label variable="locator"  form="short"/>
              <text variable="locator" prefix=" "/>
            </group>
          </group>
        </else-if>
        <else-if position="ibid">
          <text term="ibid" form="long" font-style="italic" text-case="capitalize-first"/>
        </else-if>
        <else-if position="subsequent">
          <choose>
              <if type="legal_case">
            <text macro="arret"/>
                        </if>
            <else-if type="book">
              <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <text macro="title-short"/>
                <group delimiter=" ">
                  <text term="volume" form="short"  text-case="lowercase"/>
                  <text variable="volume"/>
                </group>
                <group>
                  <label variable="locator"  form="short"/>
                  <text variable="locator" prefix=" "/>
                </group>
              </group>
            </else-if>
            <else>
              <group delimiter=", ">
                <text macro="author" font-variant="normal"/>
                <text macro="title-short"/>
                <group>
                  <label variable="locator"  form="short"/>
                  <text variable="locator" prefix=" "/>
                </group>
              </group>
            </else>
          </choose>
        </else-if>
      </choose>
    </layout>
  </citation>

  <bibliography hanging-indent="true" et-al-min="6" et-al-use-first="6">
    <sort>
            <key variable="issued"/>
      <key macro="author-bibliography"/>
      <key variable="title"/>
    </sort>
    <layout suffix=".">
      <choose>
      <if type="legal_case">
        <text macro="arret"/>
            </if>
            <else>
      <text macro="author-bibliography" suffix=", "/>
      <choose>
                <if type="book">
                  <group delimiter=", ">
            <group delimiter=" ">
              <text macro="title"/>
            </group>
            <group delimiter=" ">
              <text term="volume" form="short"  text-case="lowercase"/>
              <text variable="volume"/>
            </group>
            <text variable="edition"/>
            <text macro="publisher"/>
                        <text variable="collection-title" prefix=" coll. «" suffix="»"/>
            <date variable="issued">
              <date-part name="year"/>
            </date>
          </group>
        </if>
        <else-if type="chapter">
          <group delimiter=", ">
            <text macro="title"/>
            <group delimiter=" ">
              <text term="in"/>
              <names variable="editor translator" suffix=" (dir.)" delimiter=", ">
                <name sort-separator=", "/>
                </names>
              <text variable="container-title" font-style="italic"/>
            </group>
            <group delimiter=" ">
              <text term="volume" form="short"  text-case="lowercase"/>
              <text variable="volume"/>
            </group>
            <text variable="edition"/>
            <text macro="publisher"/>
            <group>
              <date variable="issued">
                <date-part name="year"/>
              </date>
              <text variable="collection-title" prefix=" coll. «" suffix="»"/>
            </group>
            <group>
                <text variable="page"  prefix="p. "/>
            </group>
          </group>
        </else-if>
        <else-if type="article">
          <group delimiter=", ">
            <text macro="title"/>
            <text variable="container-title" font-style="italic"/>
            <group delimiter=" ">
              <text term="volume" form="short"  text-case="lowercase"/>
              <text variable="volume"/>
            </group>
            <group delimiter=" ">
              <text term="issue" form="short"  text-case="lowercase"/>
              <text variable="issue"/>
            </group>
            <date variable="issued">
              <date-part name="year"/>
            </date>
            <text variable="edition"/>
            <group delimiter=" ">
              <text macro="publisher"/>
              <text variable="collection-title" prefix="(" suffix=")"/>
            </group>
            <group>
                            <text variable="page"  prefix="p. "/>
            </group>
          </group>
        </else-if>
                <else>
          <group delimiter=", ">
                <text macro="title"/>
            <text macro="editor-translator"/>
            <text variable="container-title" font-style="italic"/>
            <group delimiter=" ">
              <text term="volume" form="short" text-case="lowercase"/>
              <text variable="volume"/>
            </group>
            <group>
              <text term="issue" form="short" text-case="lowercase"/>
              <text variable="issue"/>
            </group>
            <group>
              <text variable="page"  prefix="p. "/>
            </group>
          </group>
        </else>
      </choose>
      <text prefix=", " macro="access"/>
            </else>
        </choose>
   </layout>
  </bibliography>
</style>

1 个答案:

答案 0 :(得分:0)

错误是xml:style中的xmlns:lang =“ sp”。删除它即可。