Item type testing in CSL 1.0 and fallbacks

2»
  • edited April 14, 2010
    could you also discuss this point ("blogPost" and "forumPost" mapping to "post-weblog" and "post" instead of "webpage", respectively)?
    That's a question only the Zotero developers can answer.
    If fallback behavior is eliminated, updating update.xsl should be fairly trivial.
    This might not be as trivial as I thought. There are some nasty corner cases, like
    <if variable="editor translator" type="book" match="all">
    You could replace "book" by all subtypes of "book", but you'd need to create a nested conditional because a conditional with match="all" will never test true if you are testing for multiple types, e.g.:
    <choose>
    <if type="book motion_picture graphic report bill
    legal_case song motion_picture" match="any">
    <choose>
    <if variable="editor translator" match="all">
    ...
    </if>
    </choose>
    </if>
    </choose>

    Plus it seems space delimited attribute values can't be easily changed with XSLT. Some hint at using regexp ( http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200907/msg00043.html ), but I haven't been able to get that working yet.
  • Plus it seems space delimited attribute values can't be easily changed with XSLT. Some hint at using regexp ( http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200907/msg00043.html ), but I haven't been able to get that working yet.
    Quick thought: depending on what you're trying to do, you might be able to use a tokenize function (native in 2.0, but available as an exslt extension in 1.0) to split the string, and then work on that list of tokens.
  • Just a quick update: I'm quite close to completing modifications to the XSLT 1.0 stylesheet so that it can convert CSL styles to cope with the elimination of fallback behavior. It'll take me a few more days to finish, but from the looks of it it shouldn't be a show stopper.
  • I have committed the required changes to the csl-utils repository:

    http://bitbucket.org/bdarcus/csl-utils/changeset/7bda7dee1871/
Sign In or Register to comment.