![]() | Menota main page List of contents |
F. Extensible Stylesheet Language Transformation (XSLT)F.1 Introduction Version 2.0 (16 May 2008) F.1 IntroductionXSLT is a language for transforming XML documents into other XML documents, or other formats, e.g. HTML. This page contains XSL Transformations (which we shall refer to as XSLT stylesheets) to be used with Menotic XML files in order to generate user-friendly HTML. To help users modify these stylesheets, they contain a number of comments explaining the intended effects of the stylesheet. The XSLT stylesheets on this page have been developed by Vemund Olstad and Tone Merete Bruvik, Aksis, University of Bergen. F.2 XSLT for Menotic textsThere are two XSLT stylesheets available:
To download these stylesheets rather than opening them, right-click (on Windows) or ctrl-click (on Mac), depending on the preferences in your browser. Otherwise, you will most likely get an error report when your browser tries to open the XSL file. These XSLT stylesheets will convert a text encoded with <facs>, <dipl> and/or <norm> tags into easily readable HTML display. Note that your computer must have a MUFI conformant font in order to display all characters correctly, especially on the <facs> level. There are two ways of choosing the display level: F.2.1 Using Oxygen (or other XML applications)You may use the parameter option in e.g. Oxygen, or in a command line. In this case, specify “facs”, “dipl” or “norm”. In Oxygen, name your scenario and choose your stylesheet (e.g menota-web-comment.xsl):
Then, set the desired parameter, e.g. for display (“visning”) on the normalised level:
Finally, define a suitable output format. If giving the extension .html, the output file can be viewed immediately in a browser: 2. By defining one XSLT stylesheet for each level. In that case, you should switch comments in this pair of lines found at the beginning of the XSL file: <!--<xsl:param name="visning" select="'norm'"/>--> <xsl:param name="visning"/> 2.1. For <facs> display, make a stylesheet with this pair of lines: <xsl:param name="visning" select="'facs'"/> <!-- <xsl:param name="visning"/> --> 2.2. For <dipl> display, make a stylesheet with this pair of lines: <xsl:param name="visning" select="'dipl'"/> <!-- <xsl:param name="visning"/> --> 2.3. For <norm> display, make a stylesheet with this pair of lines: <xsl:param name="visning" select="'norm'"/> <!-- <xsl:param name="visning"/> --> After having defined (and named accordingly) the XSLT stylesheets, you may generate HTML output in e.g. Oxygen as specified in (1) above. This time, you should not specify any parameter, since this has been done in the stylesheet itself (and for this reason you should define as many stylesheets as there are parameters).
F.2.2 Using an external transformatorIf you do not have a version of Oxygen, there is an online solution available on the Henrik Ibsen project pages. Open this link: Upload your XSLT stylesheet and XML file, and press “Submit”, as shown here:
Note that with this solution you must have one XSLT stylesheet for each parameter, as explained above. Also note that the XML file must be valid and refer to an external DTD. Thus, your XML file should look like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE TEI SYSTEM "http://www.menota.org/guidelines-2/schemes/menotaP5.dtd"> <TEI xmlns="http://www.tei-c.org/ns/1.0"> <teiHeader> . . . </teiHeader> </TEI> |
First published 24 May 2005. Last updated 16 May 2008. Webmaster. (Edit) |