Dear all
I've written two XSL 2.0 functions which might be of some interest for digital medievalists.
The first ("is_roman_number") checks if a given string is a correct Roman numeral or not (returning a boolean). E.g. <xsl:value-of select="locfun:is_roman_number('xvi')"/> returns "true".
The second ("convert_date") converts Roman dates (you know, something like 'XII Kalendas Decembris') into a string, containing the date in modern (english) format.
The function expects four parameters: 1. A string indicating the month in latin. The function is quite tolerant here. 2. A string indicating the part of the month: kalendae, nonae, idus. Again much spelling variation tolerance here. 3. A string indicating the given number of the day in Roman numerals. If your date is exactly on a fix date (eg. "kalendibus"), just write '' here. 4. A boolean for the leap year. 'true()' means 'yes, we're in a leap year'.
E.g. <xsl:value-of select="locfun:convert_date('iunii','idus','III',false())"/> will return "June 11".
Both functions use the xmlns:locfun="urn:local-functions" namespace and the xmlns:own_t="http://no-real-uri-here/arguments_and_document_node_variables_of_Christian_S..." namespace for document node variables.
You find the code file attached. You might use, edit, share it in whichever way you like!
Best regards Christian
--
Dr. Christian Schwaderer (Akademischer Mitarbeiter)
Eberhard-Karls-Universität Tübingen Philosophische Fakultät Fachbereich Geschichtswissenschaft Seminar für mittelalterliche Geschichte Wilhelmstraße 36 (Hegelbau)· 72074 Tübingen · Germany Zimmer 212 Telefon +49 7071 29-72990· Telefax +49 7071 29-5905 christian.schwaderer@uni-tuebingen.de