Skip to content

Instantly share code, notes, and snippets.

@denismaier
Created July 3, 2020 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denismaier/a42d5f8bf65b92cfd289c9e4ca940ad3 to your computer and use it in GitHub Desktop.
Save denismaier/a42d5f8bf65b92cfd289c9e4ca940ad3 to your computer and use it in GitHub Desktop.
New-conditions-tests
<?xml version="1.0"?>
<?xml-model href="../schema/schemas/styles/csl.rnc" type="application/relax-ng-compact-syntax"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.1">
<info>
<id/>
<title/>
<updated>2020-07-01T00:00:10+00:00</updated>
</info>
<citation>
<layout>
<!-- These throw errors as expected -->
<choose>
<if date-precision="day"></if>
</choose>
<choose>
<if tested="title" date-range="1900/.."></if>
</choose>
<choose>
<if tested="title issued" matches="original-title" date-range="1900/.."></if>
</choose>
</layout>
</citation>
<bibliography>
<layout>
<!-- These work as expected -->
<choose>
<if variable="DOI" tested="issued" date-precision="day">
</if>
</choose>
<choose>
<if variable="title" tested="issued" date-precision="day" date-range="1900/..">
</if>
</choose>
<choose>
<if variable="title" tested="ISBN" matches="DOI">
</if>
</choose>
<choose>
<if tested="issued" date-range="../1900" match="none">
</if>
</choose>
<choose>
<if>
<conditions>
<condition tested="issued" date-precision="day"/>
<condition tested="title" matches="original-title"/>
</conditions>
</if>
</choose>
<choose>
<if tested="title" matches="abstract" variable="title">
</if></choose>
<choose>
<if tested="issued" date-precision="year" date-range="1900/..">
</if>
</choose>
</layout>
</bibliography>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment