This project is read-only.

Use of the Type field

Mar 14, 2010 at 12:36 PM

I have figured out how to use the type field to get some special cases formated correctly in the bibliography and it works great.

However I have one concern. The value in that field is case sensitive and so it doesn't work if it isn't entered exactly as expected. Given that this will be entered by end users it is sure to become a support issue.

Can I do anything about it? e.g.

  1. Tweak BIBFORM.XML so it is always forced to lower case on entry.
  2. Tweak my style file to make it case insensitive when using type.
  3. Get it displayed as a dropdown list so the user can only supplythe values I support.


Mar 14, 2010 at 2:48 PM

The thing is that the 'Type' field solution is a workaround to start with. It shouldn't have been necessary if Microsoft decided to support some more formats.

Regarding your solutions:

1)Not possible. Word generates the xml code internally. It follows the guidelines of bibform.xml but it doens't allow you to change the content of a field.

2)You could do that. You could add a preprocess step which converts the value of the type field to all lower case and then use that. In case of citations and footnote citations, you could probably do that during the defintion of extendedSource:

<xsl:variable name="extendedSource">
    <!-- Copy everything except the Type field. -->
    <!-- Add the type field in lower or upper case. -->
<!-- Do the rest of extending the source. -->
</b:Source> </xsl:variable>

In case of a bibliography, you could do that during the generation of the sort key.

3)This is possible. All you have to do is extend bibform.xml to incorporate your own type. The thing is, if you follow this road, you will be generating xml which no longer complies to the xml schema for bibliographies. As Word doesn't check the schemas when generating documents (which is a serious flaw if you ask me) this isn't a problem in Word. However, you have no idea how other programs will handle your document. If they follow the strict schema definition, they might throw some kind of exception. It is highely unlikely, but it is possible.

Mar 19, 2010 at 8:45 PM

Thanks Yves

I wasn't sure where I would add that code for option 2 so I found another route. Everytime you use Type to pick a format (in things like format-citation or format-bibliography) you first create a variable so I just modified those statements e.g.

<xsl:variable name="temp" select="./b:Type"></xsl:variable>               
<xsl:variable name="temp" select="translate(./b:Type, $uppercase, $lowercase)"></xsl:variable>

I ended up changing 4 or 5 points and maybe it could be done more efficiently but doing it this way means that if the format statement ever need to include %Type% then it will still display what the user entered.

Thanks once again for your help.