2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
hl=
"java:net.sf.xslthl.ConnectorSaxon6"
4 xmlns:
exsl=
"http://exslt.org/common"
5 exclude-result-prefixes=
"exsl hl"
8 <!-- ********************************************************************
9 $Id: common.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
14 and other information.
16 ******************************************************************** -->
18 <!-- You can override this template to do more complex mapping of
19 language attribute to highlighter language ID (see xslthl-config.xml) -->
20 <xsl:template name=
"language.to.xslthl">
21 <xsl:param name=
"context"/>
24 <xsl:when test=
"$context/@language != ''">
25 <xsl:value-of select=
"$context/@language"/>
27 <xsl:when test=
"$highlight.default.language != ''">
28 <xsl:value-of select=
"$highlight.default.language"/>
33 <xsl:template name=
"apply-highlighting">
35 <!-- Do we want syntax highlighting -->
36 <xsl:when test=
"$highlight.source != 0 and function-available('hl:highlight')">
37 <xsl:variable name=
"language">
38 <xsl:call-template name=
"language.to.xslthl">
39 <xsl:with-param name=
"context" select=
"."/>
43 <xsl:when test=
"$language != ''">
44 <xsl:variable name=
"content">
45 <xsl:apply-templates/>
47 <xsl:apply-templates select=
"hl:highlight($language, exsl:node-set($content))"/>
50 <xsl:apply-templates/>
54 <!-- No syntax highlighting -->
56 <xsl:apply-templates/>