In the following fixture, the <label>
is expected to render art.
and <else-if locator="article-locator">
should test true for the cite item with "label": "article-locator"
. But the current citeproc-js gives:
+ expected - actual
p. 42 is page
-42 is other
+art. 42 is article-locator
art. 43 is other
The locator article
(without -locator
) seems to work but the validator complains “Bad value ‘article’ for attribute ‘locator’ on element ‘else-if’” and <else-if locator="article">
tests false.
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== RESULT =====>>
p. 42 is page
art. 42 is article-locator
art. 43 is other
<<===== RESULT =====<<
>>===== CITATION-ITEMS =====>>
[
[
{
"id": "ITEM-1",
"locator": "42",
"label": "page"
}
],
[
{
"id": "ITEM-1",
"locator": "42",
"label": "article-locator"
}
],
[
{
"id": "ITEM-1",
"locator": "43",
"label": "article"
}
]
]
<<===== CITATION-ITEMS =====<<
>>===== CSL =====>>
<style
xmlns="http://purl.org/net/xbiblio/csl"
class="note"
version="1.0">
<info>
<id />
<title />
<updated>2023-07-29T19:35:54+08:00</updated>
</info>
<citation>
<layout>
<group delimiter=" ">
<label variable="locator" form="short"/>
<text variable="locator"/>
<choose>
<if locator="page">
<text value="is page"/>
</if>
<else-if locator="article-locator">
<text value="is article-locator"/>
</else-if>
<else-if locator="article">
<text value="is article"/>
</else-if>
<else>
<text value="is other"/>
</else>
</choose>
</group>
</layout>
</citation>
</style>
<<===== CSL =====<<
>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"type": "legislation"
}
]
<<===== INPUT =====<<
>>===== VERSION =====>>
1.0
<<===== VERSION =====<<