>>===== MODE =====>>
citation
<<===== MODE =====<<


This is an example of "parallel" citation collapsing based on rendered
content, with a French case and comment string citation.

The comment portion of this result is, I believe, WRONG. The delimiter
between page-pinpoint/author elements of the same journal should be
comma (subject to confirmation if there is demand in France). This
will require an extension to implement---probably something like
parallel-delimiter-override-on-fail, with supporting code in
node_group.js.


>>===== RESULT =====>>
Cass. 1ere civ., March 28, 2000, <i>JCP G</i>, 2000, 10296, <span style="font-variant:small-caps;">J. Sainte-Rose</span>; <i>D</i>, 2000, somm. p. 358, <span style="font-variant:small-caps;">Ph. Delebecque</span>, p. 900, <span style="font-variant:small-caps;">S. Piedelievre</span>.
<<===== RESULT =====<<

>>===== CITATION-ITEMS =====>>
[
    [
        {
            "id": "ITEM-1"
        }, 
        {
            "id": "ITEM-2"
        }, 
        {
            "id": "ITEM-3"
        }
    ]
]
<<===== CITATION-ITEMS =====<<

>>===== CSL =====>>
<style
       xmlns="http://purl.org/net/xbiblio/csl"
      class="note"
      version="1.1mlz1"
      page-range-format="chicago">
  <info>
    <title>Test fixture</title>
    <id>http://citationstyles.org/tests/fixture</id>
    <link href="http://citationstyles.org/tests/fixture" rel="self"/>
    <link href="http://citationstyles.org/documentation/text" rel="documentation"/>
    <category citation-format="author-date"/>
    <updated>2014-04-30T13:19:38+00:00</updated>
    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
  </info>
  <locale>
	<terms>
	  <term name="ibid">id.</term>
	</terms>
  </locale>

  <!-- ### BLUEBOOK AUTHOR ### -->
  <macro name="bb-author">
	<names variable="author">
	  <name/>
	</names>
  </macro>
  <macro name="bb-author-short">
	<names variable="author">
	  <name form="short"/>
	</names>
  </macro>

  <!-- ### BLUEBOOK ISSUED ### -->
  <macro name="bb-issued">
	<group prefix="(" suffix=")">
	  <date variable="issued" form="text" date-parts="year"/>
	</group>
  </macro>

  <!-- ### ID BACKREFERENCES ### -->
  <macro name="bb-ibid">
	<choose> 
	  <if position="ibid-with-locator">
		<text term="ibid" font-style="italic"/>
		<group delimiter=" ">
		  <choose>
			<if locator="page">
			  <text value=" at"/>
			</if>
			<else>
			  <text value=", "/>
			  <label form="short" variable="locator"/>
			</else>
		  </choose>
		  <text variable="locator"/>
		</group>
	  </if>
	  <else-if position="ibid">
		<text term="ibid" font-style="italic"/>
	  </else-if>
	</choose>
  </macro>

  <!-- ### POINT LOCATORS -->
  <macro name="bb-point-locator-comma">
	<group delimiter=" ">
	  <choose>
        <if variable="number page" position="ibid" match="any">
		  <text value=","/>
        </if>
	  </choose>
	  <choose>
        <if locator="page" match="none">
		  <label form="symbol" variable="locator"/>
	    </if>
	  </choose>
	  <text variable="locator"/>
	</group>
  </macro>
  <macro name="bb-point-locator-base">
    <group delimiter=" ">
  	<choose>
        <if locator="page" match="none">
	  	<label form="symbol" variable="locator"/>
	    </if>
  	  </choose>
  	  <text variable="locator"/>
    </group>
  </macro>

  <!-- ### LEGAL CASE ### -->
  <macro name="bb-legal-case">
	<choose>
	  <if position="first">
		<text macro="bb-legal-case-first"/>
	  </if>
	  <else-if position="ibid">
		<text macro="bb-ibid"/>
	  </else-if>
	  <else-if position="near-note">
		<text macro="bb-legal-case-subsequent"/>
	  </else-if>
	  <else>
		<text macro="bb-legal-case-first"/>
	  </else>
	</choose>
  </macro>
  <macro name="bb-legal-case-first">
    <choose>
      <if variable="title">
        <!-- Common law cases -->
		<group delimiter=", ">
		  <text variable="title"/>
		  <group delimiter=" ">
			<choose>
			  <if variable="issue">
				<number variable="volume" prefix="[" suffix="]"/>
				<number variable="issue"/>
			  </if>
			  <else>
				<number variable="volume"/>
			  </else>
			</choose>
			<text variable="container-title" form="short"/>
			<group>
			  <number variable="page"/>
			  <text macro="bb-point-locator-comma"/>
			</group>
			<group prefix="(" suffix=")" delimiter=" ">
              <group parallel-first="authority issued" prefix="[" suffix="]">
                <names variable="authority">
                  <name form="short"/>
                </names>
              </group>
			  <date variable="issued">
				<date-part name="year"/>	
			  </date>
			</group>	
		  </group>
		</group>
	  </if>
      <else>
	<!-- Civil law cases -->
	<group delimiter=", ">
          <group parallel-first="authority">
            <names variable="authority">
              <name form="short"/>
            </names>
          </group>
		  <text variable="title" form="short"/>
          <group parallel-first="issued">
  	 	    <date variable="issued" form="text"/>
          </group>
          <group delimiter=", " parallel-first="container-title" parallel-delimiter-override-on-suppress=", ">
		      <text variable="container-title" font-style="italic" strip-periods="true"/>
		      <number variable="volume"/>
          </group>
          <group delimiter=" ">
            <group parallel-first="section container-title">
			  <text variable="section"/>
            </group>
            <label variable="page" form="short"/>
            <number variable="page"/>
		  </group>
          <group parallel-first="number">
             <number variable="number"/>
          </group>
          <group delimiter=" ">
            <text variable="genre"/>
  		    <names variable="author">
			  <name initialize-with="." font-variant="small-caps"/>
		    </names>
		  </group>
		</group>
	  </else>
	</choose>
  </macro>
  <macro name="bb-legal-case-subsequent">
    <group delimiter=", ">
      <text variable="title" form="short"/>
      <group delimiter=" ">
		<choose>
		  <if variable="issue">
			<number variable="volume"/>
			<number variable="issue"/>
		  </if>
		  <else>
			<number variable="volume"/>
		  </else>
		</choose>
        <text variable="container-title" form="short"/>
		<choose>
          <if variable="locator">
            <text macro="bb-point-locator-base"/>
		  </if>
		  <else>
		    <number variable="page"/>
		  </else>
		</choose>
      </group>
	</group>
  </macro>

  <!-- ### LEGISLATION ### -->
  <macro name="bb-legislation">
	<choose>
	  <if position="first">
		<text macro="bb-legislation-first"/>
	  </if>
	  <else-if position="near-note">
		<text macro="bb-legislation-subsequent"/>
	  </else-if>
	  <else>
		<text macro="bb-legislation-first"/>
	  </else>
	</choose>
  </macro>
  <macro name="bb-legislation-first">
	<choose>
	  <if variable="container-title">
		<text macro="bb-statute-first"/>
	  </if>
	  <else>
		<text macro="bb-code-first"/>
	  </else>
	</choose>
  </macro>
  <macro name="bb-legislation-subsequent">
	<choose>
	  <if variable="container-title">
		<text macro="bb-statute-subsequent"/>
	  </if>
	  <else>
		<text macro="bb-code-subsequent"/>
	  </else>
	</choose>
  </macro>
  <macro name="bb-statute-first">
	<group delimiter=", ">
	  <text variable="title"/>
	  <text macro="bb-statute-subsequent"/>
	</group>
  </macro>
  <macro name="bb-statute-subsequent">
   <group delimiter=" ">
	<group delimiter="">
	  <group delimiter=" ">
		<number variable="volume"/>
		<text variable="container-title"/>
		<number variable="number"/>
		<number variable="page"/>
		<choose>
		  <if is-numeric="section">
			<text term="section" form="symbol"/>
			<text variable="section"/>
		  </if>
		</choose>
	  </group>
	  <text macro="bb-point-locator-comma"/>
     </group>
	 <date prefix="(" variable="issued" date-parts="year" form="text" suffix=")"/>
	</group>
  </macro>
  <macro name="bb-code-first">
	<group delimiter=" ">
	  <text variable="title" font-variant="small-caps"/>
	  <group delimiter=" ">
		<label variable="locator" form="symbol"/>
		<text variable="locator"/>
	  </group>
	</group>
  </macro>
  <macro name="bb-code-subsequent">
	<group delimiter=" ">
	  <text variable="title" form="short" font-variant="small-caps"/>
	  <group delimiter=" ">
		<label variable="locator" form="symbol"/>
		<text variable="locator"/>
	  </group>
	</group>
  </macro>

  <!-- ### BOOK ### -->
  <macro name="bb-book">
	<choose>
	  <if position="first">
		<text macro="bb-book-first"/>
	  </if>
	  <else-if position="ibid">
		<text macro="bb-ibid"/>
	  </else-if>
	  <else-if position="subsequent">
		<text macro="bb-book-subsequent"/>
	  </else-if>
	</choose>
  </macro>
  <macro name="bb-book-first">
	<group delimiter=", ">
	  <text macro="bb-author" font-variant="small-caps"/>
	  <group delimiter=" ">
		<text variable="title" font-variant="small-caps"/>
		<group delimiter=" ">
		  <choose>
			<if locator="page" match="none">
			  <label variable="locator" form="symbol"/>
			</if>
		  </choose>
		  <text variable="locator"/>
		</group>
		<text macro="bb-issued"/>
	  </group>
	</group>
  </macro>
  <macro name="bb-book-subsequent">
    <group delimiter=", ">
	  <text macro="bb-author-short" font-variant="small-caps"/>
	  <choose>
		<if disambiguate="true">
		  <text variable="title" font-variant="small-caps"/>
		</if>
	  </choose>
	  <group delimiter="">
		<group delimiter=" ">
		  <text value="supra" font-style="italic"/>
		  <choose>
			<if variable="first-reference-note-number">
			  <text value="note"/>
			  <text variable="first-reference-note-number"/>
			</if>
		  </choose>
		</group>
		<group delimiter=" ">
		  <choose>
			<if locator="page">
			  <text value=","/>
			  <text value="at"/>
			</if>
			<else>
			  <label variable="locator"/>
			</else>
		  </choose>
		  <text variable="locator"/>
		</group>
	  </group>
	</group>
  </macro>

  <!-- ### PERIODICAL ### -->
  <macro name="bb-periodical">
	<choose>
	  <if position="first">
		<text macro="bb-periodical-first"/>
	  </if>
	  <else-if position="ibid">
		<text term="ibid" font-style="italic"/>
	  </else-if>
	  <else-if position="subsequent">
		<text macro="bb-periodical-subsequent"/>
	  </else-if>
	</choose>
  </macro>
  <macro name="bb-periodical-first">
	<group delimiter=" ">
	  <group delimiter=", ">
		<names variable="author">
		  <name/>
		</names>
		<text variable="title" font-style="italic"/>
		<group delimiter=" ">
		  <number variable="volume"/>
		  <text variable="container-title" form="short" font-variant="small-caps"/>
		  <number variable="page-first"/>
		</group>
	  </group>
	  <text macro="bb-issued"/>
	</group>
  </macro>
  <macro name="bb-periodical-subsequent">
	<text value="bb-periodical-subsequent"/>
  </macro>
  <citation
         near-note-distance="5"
         et-al-min="2"
         et-al-subsequent-min="4"
         et-al-subsequent-use-first="2"
         et-al-use-first="1">
    <layout delimiter="; " suffix=".">
      <choose>
        <if type="legal_case">
          <text macro="bb-legal-case"/>
        </if>
		<else-if type="legislation">
		  <text macro="bb-legislation"/>
		</else-if>
		<else-if type="book" match="any">
		  <text macro="bb-book"/>
		</else-if>
        <else>
		  <text macro="bb-periodical"/>
		</else>
	  </choose>
    </layout>
  </citation>
</style>

<<===== CSL =====<<


>>===== INPUT =====>>
[
    {
        "author": [
            {
                "family": "Sainte-Rose", 
                "given": "J."
            }
        ], 
        "authority": "Cass. 1ere civ.", 
        "container-title": "JCP G", 
        "id": "ITEM-1", 
        "issued": {
            "date-parts": [
                [
                    "2000", 
                    "3", 
                    "28"
                ]
            ]
        }, 
        "number": "10296", 
        "type": "legal_case", 
        "volume": "2000",
        "seeAlso": ["ITEM-1", "ITEM-2", "ITEM-3"]
    }, 
    {
        "author": [
            {
                "family": "Delebecque", 
                "given": "PHillip"
            }
        ], 
        "authority": "Cass. 1ere civ.", 
        "container-title": "D.", 
        "id": "ITEM-2", 
        "issued": {
            "date-parts": [
                [
                    "2000", 
                    "3", 
                    "28"
                ]
            ]
        }, 
        "number": "10296", 
        "page": "358", 
        "section": "somm.", 
        "type": "legal_case", 
        "volume": "2000",
        "seeAlso": ["ITEM-1", "ITEM-2", "ITEM-3"]
    }, 
    {
        "author": [
            {
                "family": "Piedelievre", 
                "given": "S."
            }
        ], 
        "authority": "Cass. 1ere civ.", 
        "container-title": "D.", 
        "id": "ITEM-3", 
        "issued": {
            "date-parts": [
                [
                    "2000", 
                    "3", 
                    "28"
                ]
            ]
        }, 
        "number": "10296", 
        "page": "900", 
        "section": "somm.", 
        "type": "legal_case", 
        "volume": "2000",
        "seeAlso": ["ITEM-1", "ITEM-2", "ITEM-3"]
    }
]
<<===== INPUT =====<<
