Splitting variables in CSL?

Is it currently possible to split a variable string into substrings using CSL?

I got to this while trying to figure out a way to automatically append the PMCID onto my bibliography entries. Certainly I can use the "Extras" field for this purpose, but what happens if I want PMID and PMCID, or if there is another "extra" I need? One option would be to split the "note" variable into the proper segments based on delimiters. I couldn't find a way to do it. For example, suppose Extras had "PMID: 1111111; PMCID: 2222222;". If I could split the entire thing by "PMCID: " and ";", then I would have my PMCID leftover. Same for other types of IDs. Perhaps this would also help with the four-letter citation (AbCd10) and subtitles in recent discussions. Another approach might be to have additional "extra" or "user" fields for customized input/output like this. Having only one "extra" is limiting.
  • It's not possible atm.
    Splitting fields sounds like a nightmare to deal with from a programming point of view.
    I'm not sure how I feel about more custom fields, but the main reason they don't exist is that user specific custom fields suck for sharing data between users - one of Zotero's principal purposes.
  • I ee your point. However, if multiple users need the same information (eg, PMCID), then the custom field serves a purpose. If implementing specific fields for PMID, PMCID, etc. is too burdensome because not everyone works on NIH-sponsored efforts, then having a user-customizable field seems like a reasonable workaround to me -- certainly better than nothing at all.
  • The problem with a custom field would be that users wouldn't necessarily use it the same way. I think there is a case to be made to have optional fields for PMID and ArXiv IDs that users can toggle on and off - within certain fields these are very common and are increasingly used in citations, too.
    That'd be much more in the spirit of data exchange that custom fields which sound too much like a workaround to me, which would then stand in the way of better long term solutions.
  • There has been discussion of how to handle identifiers in CSL. There is a need for extended support in this area, although a specific approach has not yet emerged. Hacking data into the Extra field is not the way to go, though, at least as a general solution.
  • edited October 18, 2010
    Yeah, I'd tend to lean towards adamsmiths' suggestion (in fact, I generally think we need more flexibility in the interface; there are a lot of times I'm frustrated by a missing field), and to be quite liberal about adding identifiers to CSL. Custom fields do suck, and I'm unlikely to ever support any sort of string processing to CSL beyond what we already have.
Sign In or Register to comment.