Doesn’t it make more sense to do “page”:“23”? Seems simpler, and more
flexible.
How would text declarations find the correct input field in that case?
Just write the mapping? Am just proposing a shortcut that uses the
locator tyoe as the key. Your code can be responsible for knowing
they’re all locators.
The problem with your approach is it doesn’t leave room for multiple locators.
… which might be handy. The cite object will also need to carry
cite and note sequence numbers. To avoid stepping through all of the
possibilities to sort out what is a locator and what is other
metadata, could we do this:
Sure (but I’d use the plural on the locators key, since it’s an array).
I gave this some more thought during the commute, and I’m unsure
whether it’s a good idea to break the data down in this way. Ideally,
it’s right, but it might create as many problems as it solves. There
are two factors in the mix behind that thought.
First, a simple array of objects won’t be enough to capture the full
structure of complex locators. There will be things like this:
pp. 23 n. 4, 15-20.
p. 101, sec. 10 p. 9.
To get the joins right in rendering, you would need (at least) a
double-nested array.
That leads to the thought that, possibly, structured delivery of
locator details may be too much to demand of the calling application.
Some, perhaps all applications will have the user entering this data
as a text string. If that’s the case, the parsing will be
complicated, and if the parsing is reimplemented across different
applications, they will start coming up with different results, out of
sight of the processor. If we’re moving toward a world in which users
of Zotero and Mendeley, using different CSL processors, collaborate in
the editing of shared documents, it seems like that situation could
very quickly lead to user complaints, finger pointing and FUD.
I would certainly prefer to receive the locator in a structured form,
with all of the hints needed to render it correctly. But I think we
need to hear from the UI and delivery side (Simon, Dan, Andrea,
Steve?) before settling on a cross-processor input format for this
part of the data. (I’ve been afflicted by needless doubts before, and
I would be delighted to be told that this is one of them; but this
mail just in case.)
Frank