CSTUG

Stylesheet

<xsl:stylesheet version="2.0" exclude-result-prefixes="c">

<!-- This stylesheet can generate bibliography references of articles from the CSTUG Bulletin. Their identifiers are taken from an XML file. You can find a sample file as cite-sample.xml within this package or on http://bulletin.cstug.cz/xml/. The file must be valid with respect to cstugbulletin.rng (available from the above URL) or alternatively to the non-normative Schemas available from the same page. Stylesheet bibliography.xsl is intended for XSLT 1.0 processors. bibliography2.xsl for XSLT 2.0 processors. The former makes use of the node-set() function and tries to find it in different extensions. If your processor needs another extension, please let me know. The stylesheet can output the bibliography in two forms: 1. XML (see the documented Relax NG scheme cstugbulletin.rng) 2. LaTeX (this might require editing before inclusion into your document) The format is chosen by setting the output method and the value of the acromode parameter: XML output: method=xml acromode=xml LaTeX output: method=text acromode=TeX The lang parameter specifies preferred language of the titles (if the translations are available). Its default is cze and must be given as the ISO 639-2 3-letter code. Saxon v.8 can specify both the parameters and <output> attributes on the command line, e.g.: acromode=xml lang=eng !method=xml !indent=yes !encoding=iso-8859-2 You can even define Saxon extensions attribute, e.g.: !{http://saxon.sf.net/}character-representation=native If your XSLT processor lacks such possibilities, you should set the <output> attributes in your stylesheet and import either bibliography.xsl or bibliography2.xsl. You can even import the stylesheet directly from the web by using one of the following: <xsl:import href="http://bulletin.cstug.cz/xml/document/bibliography.xsl"/> or <xsl:import href="http://bulletin.cstug.cz/xml/document/bibliography2.xsl"/> Notice that the stylesheet (if invoked locally) requires stylesheets from xslcsbul.zip. -->
<xsl:import href="bibliography-incl.xsl"/> <xsl:import href="index2.xsl"/> <xsl:include href="kwd2.xsl"/> <xsl:template match="c:bibliography"> <xsl:variable name="artlist"> <xsl:apply-templates select="document($toclist, $indexhref)"/> </xsl:variable> <xsl:choose> <xsl:when test="$acromode = "xml""> <citationList> <xsl:copy-of select="@*"/> <xsl:attribute name="lastModified"> <xsl:value-of select="current-dateTime()"/> </xsl:attribute> <xsl:apply-templates> <xsl:with-param name="artlist" select="$artlist"/> </xsl:apply-templates> </citationList> </xsl:when> <xsl:when test="$acromode = "TeX""> <xsl:text>% Requires csbulacronym.sty </xsl:text> <xsl:text>\ActiveAmpersand </xsl:text> <xsl:apply-templates mode="TeX"> <xsl:with-param name="artlist" select="$artlist"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes"> Value of parameter acromode must be either xml or TeX, <xsl:value-of select="$acromode"/> is not allowed. </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="c:cite"> <xsl:param name="artlist"/> <xsl:copy-of select="$artlist/key("article", current()/@id)"/> </xsl:template> <xsl:template match="c:cite" mode="TeX"> <xsl:param name="artlist"/> <xsl:apply-templates select="$artlist/key("article", current()/@id)" mode="TeX"/> </xsl:template> </xsl:stylesheet>

bibliography2.xsl