I’m just about done reworking citeproc to use rdf instead of MODS, and
have been simplifying the code along with this.
One of those changes was to add a cp:format-date function, which
simplifies things a fair bit compared the MODS equivalent.
Here’s how dates are currently configured in CSL:
<date-config jan="January" feb="February" mar="March" apr="April"
may=“May” jun="June"
jul="July"
aug="August"
oct="October"
nov="November"
dec=“December”/>
One then has to do stuff like this in each definition:
<refttype …>
...Here is how formating config is now handled in my latest experiments:
<date-config full="[Y], [MNn] [D]" month-day="[MNn] [D]"/>
What’s good about this: uses xpath 2.0-native date config and it
handles internationalization. Really easy n other words.
What is not so good: different languages handle this formatting config
differently. Ruby, Python, PHP, Perl and probably a bunch of other
languages all do something like this:
<date-config full="%Y, %B %d" month-day="%B %d"/>
So I could do that and just figure out how to use xpath to convert it
to its native syntax.
Or, I could do this all XML; a la:
So configuring it in CSL would be:
… or:
Any opinions?
Bruce