seboettg / citeproc-php

Full-featured CSL 1.0.1 processor for PHP
MIT License
73 stars 38 forks source link

cs:if not working if type and variable set and match="none" #116

Closed urshofer closed 2 years ago

urshofer commented 2 years ago

Please follow the general troubleshooting steps first:

Bug reports:

This should not print the macro issue, because match "none" should work on both type and variable. The bug leads to a doubling of the location (see example below):

<choose>
    <if type="speech" variable="publisher publisher-place" match="none">
        <text macro="issue"/>
    </if>
</choose>

if I rewrite the code as following, it seems to work:

<choose>
    <if type="speech" match="none">
        <choose>
                <if variable="publisher publisher-place" match="none">
                        <text macro="issue"/>
                </if>
        </choose>
    </if>
</choose>

Used CSL stylesheet:

chicago-fullnote-bibliography-16th-edition.csl

Used CSL metadata

Should render:

Abramson, Daniel. "Bank of England." In John Soane Architect: Master of Space and Light, edited by Margaret Richardson and Mary Anne Stevens, 208-51. London: Royal Academy of Arts, 1999.

Does render:

Abramson, Daniel. "Bank of England". In John Soane Architect: Master of Space and Light, edited by Margaret Richardson and Mary Anne Stevens, 208-51. London: Royal Academy of Arts, 1999, London: Royal Academy of Arts, 1999.

[
  {
    "author": [
        {
            "given": "Daniel",
            "family": "Abramson"
        }
    ],
    "container-title": "John Soane Architect: Master of Space and Light",
    "editor": [
        {
            "given": "Margaret",
            "family": "Richardson"
        },
        {
            "given": "Mary Anne",
            "family": "Stevens"
        }
    ],
    "type": "chapter",
    "id": "abramson_bank_1999",
    "citation-label": "abramson_bank_1999",
    "issued": {
        "date-parts": [
            [
                1999
            ]
        ]
    },
    "page": "208-251",
    "publisher-place": "London",
    "publisher": "Royal Academy of Arts",
    "title": "Bank of England"
  }
]