warzone2100: New nixpkg.
[nixpkgs-libre.git] / doc / quote-literals.xsl
blob03971bff90dc9c0d10faa2d22a594536a0f46e0c
1 <?xml version="1.0"?>
3 <xsl:stylesheet
4 version="1.0"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 xmlns:str="http://exslt.org/strings"
7 extension-element-prefixes="str">
9 <xsl:output method="xml"/>
11 <xsl:template match="function|command|literal|varname|filename|option|quote">`<xsl:apply-templates/>'</xsl:template>
13 <xsl:template match="token"><xsl:text> </xsl:text><xsl:apply-templates /><xsl:text>
14 </xsl:text></xsl:template>
16 <xsl:template match="screen|programlisting">
17 <screen><xsl:apply-templates select="str:split(., '&#xA;')" /></screen>
18 </xsl:template>
20 <xsl:template match="section[following::section]">
21 <section>
22 <xsl:apply-templates />
23 <screen><xsl:text>
24 </xsl:text></screen>
25 </section>
26 </xsl:template>
28 <xsl:template match="*">
29 <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
30 <xsl:copy-of select="namespace::*" />
31 <xsl:for-each select="@*">
32 <xsl:attribute name="{name(.)}" namespace="{namespace-uri(.)}">
33 <xsl:value-of select="."/>
34 </xsl:attribute>
35 </xsl:for-each>
36 <xsl:apply-templates/>
37 </xsl:element>
38 </xsl:template>
40 <xsl:template match="text()">
41 <xsl:value-of select="translate(., '‘’“”—', concat(&quot;`'&quot;, '&quot;&quot;-'))" />
42 </xsl:template>
44 </xsl:stylesheet>