Not an answer, more a musing on feasabilty.
Given biblatex
's current abilities, a CSL-Latex "style" certainly looks possible.
Further, using multiple citation styles in the one document is also possible with current biblatex
, so probably the CSL-equivalent of that could be called something like CSLL
, for the meta-language.
Biblatex
is doing so many things, the concept of "axes" might be useful. CSL would involve the style axis (and perhaps the item-sequence axis).
Using legal citation as an example, legal citation is basically an author-title system, where the author is understood (a court, a parliament, a regulatory authority), and the title is the name of the case, statute or regulation.
The level of granularity required for a bibentry is driven by the lowest-level specification across all legal citation styles. For example, one style will require an upright v ("versus") followed by an abbreviation dot (v.
, eg Modern Law Review) where another style specifies dotless italic v (v, eg McGill in Canada, with c, "contre", in Canadian French). So the granularity requires the party separator (if there is more than one party) to be a field in its own right.
So here there are already four style "atoms": (i) whether or not there is a party separator abbreviation in the case name; (ii) whether it is v
or c
or something else; (iii) whether it is italic or not; (iv) whether it is dotted or not. This is all really just toggling and choices.
Then there a times when multiple citation styles are required in the same document, and having to use just one citation command to handle that would be convenient.
Using key-value pairs is one way to implement a (multi)style like this, so that a particular citation style becomes "just" a package option which sets a set of (usually many) key-value pairs.
I
For example, McGill-style could be selected via package option:
\usepackage[...,lawcitestyle=mcgill,...]biblatex
which in turn sets the style parameters and toggles
\newcommand\lcsetstylemcgill{%
\togglefalse{partysepdotted}%
\toggletrue{partysepitalic}%
\toggletrue{partynamesitalic}%
...
}
which in turn means that the bibmacros and fieldformats need only look at their own fields, logically independent of which actual style the user has selected (or switched to or from):
\DeclareFieldFormat{partysep}{%
%#1
\iftoggle{partysepitalic}{%true
\mkbibemph{#1}{\iftoggle{partysepdotted}{\adddot}{}}%
}%end true
{%false
#1{\iftoggle{partysepdotted}{\adddot}{}}%
}%end false
}%end
(Note: the above code could be re-written more efficiently)
Changing styles, even mid-sentence, becomes trivial. Just toggle the toggle(s). Or better: a switch to do that.
II
Sometimes, though, the sequence of items needs to be re-arranged "on the fly".
So with a user-defined sequence of items stored in a bibentry field (in effect, the items are a type of very simple markdown):
@book{ualbertabook,
author={Kevin P McGuinness},
title={Canadian Business Corporations Law},
edition = {3},
volume = {1},
publisher={LexisNexis Canada},
location = {Toronto},
date={2017},
keywords = {lawbook},
yoptions = {name, dot, space, title, comma, space, edition, space, lparen, location, colon, space, publisher, comma, space, year, rparen, space, volume, dot},
}
the citation command can iterate through the list, doing a regex-replace
\regex_replace_all:nnN
{ comma }
{ \c{addcomma} }
\l_myscriptname_tl
...
Easier to see the item-sequence as a table:

This is a "bottom-up" approach, where style "atoms" build up to the result.
III
And rather than necessarily storing the style information in a bibentry, dynamic commands can be used.
Here is a very simple example:
With an intended sequence/structure like this:
guide=aglc
citetype=case
items
item:title
itemtitlepart:partya
itemtitlepart:partya:format=italic
itemtitlepart:partya:delim=space
itemtitlepart:partysep
itemtitlepart:partysep:text:default=v
itemtitlepart:partysep:format=italic
itemtitlepart:partysep:delim=space
itemtitlepart:partyb
itemtitlepart:partyb:format=italic
itemtitlepart:partya:delim=none
item:title:format=none
item:title:delim=space
item:refmnc
item:refmnc:year
item:refmnc:year:format=brackets
item:refmnc:year:delim=space
item:refmnc:courtname
item:refmnc:courtname:format=none
item:refmnc:courtname:delim=space
item:refmnc:casenumber
item:refmnc:casenumber:format=none
item:refmnc:casenumber:delim=none
then using a high-level style-pointer like this:
\renewcommand\lguide{aglc}
and a bibentry like this:
@case{croome,
partya = {Croome},
partyb = {Tasmania},
caseshortname = {Croome},
%paper
reportyear={1997},
reportvolume = {191},
reportseries = {CLR},
reportpage = {119},
}
cited like this:
\yycite[\nopp 125]{croome}
which uses the cite command to call (in this case) a core macro
\DeclareCiteCommand{yycite}%
{\usebibmacro{prenote}}%
{%
\usebibmacro{yycore}% <===================
}%
{%
\multicitedelim%
}%
{\usebibmacro{postnote}}
which in turn calls the sequence of items
\newbibmacro{yycore}{%
%\usebibmacro{set:multidelim}%
\usebibmacro{yycore:seq}% <===================
\usebibmacro{yycore:postnoteprelim}%
}
which in this case is static/hard-coded, but can instead be a dynamic macro:
\newbibmacro{yycore:seq}{%
\usebibmacro{yy:case:partya}%
\usebibmacro{yy:case:partyb}%
\usebibmacro{yy:case:mnc}%
\usebibmacro{yy:case:report}%
}
which in turn unfolds or expands into (for example, looking at the first item) the formatted item and its (formatted) delimiter:
\newbibmacro{yy:case:partya}{%
\iffieldundef{partya}{}{%
\printfield[\lguide :case:item:titlepart:partya:format]{partya}%
\printfield[\lguide :case:item:titlepart:partya:delim]{partya}%
}%
}
the item's formatting for the selected style looking like this
\DeclareFieldFormat[case]{aglc:case:item:titlepart:partya:format}{\mkbibitalic{#1}}
and the delimiter looking like this
\DeclareFieldFormat[case]{aglc:case:item:titlepart:partya:delim}{\addspace}
and so, similarly for the other fields, to produce:

the whole aglc:case:item:titlepart:partya:delim
string could be dynamically built up from :
-separated macros defined from reading an input file (someone will still have to write the legal CSL file(s), though :) ).
Biblatex
is already applying styles (through style files), so the equivalent of CSL.
Biblatex
is also doing style transformations ("CST") on style objects ("CS:O"), so, intuitively, mapping a CSL-style into a Biblatex
-style, at the atom-to-atom level, should be straightforward. Like a bundle of options.
Doing it at the style-level, where the "atoms" already form a style "molecule" so to speak, would be much more intricate (though not impossible) with, presumably, unwrapping and re-wrapping things.