Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 9f452694b2d23dacae7f9cc757f9be50 > files > 564

docbook-style-xsl-1.78.1-1.fc17.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>highlight.source</title><link rel="stylesheet" type="text/css" href="../reference.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="../index.html" title="DocBook XSL Stylesheets: Reference Documentation"><link rel="up" href="misc.html" title="Miscellaneous"><link rel="prev" href="table.footnote.number.symbols.html" title="table.footnote.number.symbols"><link rel="next" href="highlight.xslthl.config.html" title="highlight.xslthl.config"><link rel="copyright" href="copyright.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">highlight.source</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="table.footnote.number.symbols.html">Prev</a> </td><th width="60%" align="center">Miscellaneous</th><td width="20%" align="right"> <a accesskey="n" href="highlight.xslthl.config.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="highlight.source"></a><div class="titlepage"></div>

<div class="refnamediv"><h2><span class="refentrytitle">highlight.source</span></h2><p>
highlight.source
 &#8212; Should the content of <a href="http://docbook.org/tdg5/en/html/programlisting.html"><code class="sgmltag-element">programlisting</code></a>
be syntactically highlighted?
</p></div>

<div class="refsynopsisdiv"><h2>Synopsis</h2>
<a name="highlight.source.frag"></a><pre class="programlisting">
&lt;xsl:param name="highlight.source" select="0"&gt;&lt;/xsl:param&gt;
</pre>
</div>

<div class="refsection"><a name="idp2123056"></a><h2>Description</h2>

<p>When this parameter is non-zero, the stylesheets will try to do syntax highlighting of the 
content of <a href="http://docbook.org/tdg5/en/html/programlisting.html"><code class="sgmltag-element">programlisting</code></a> elements. You specify the language for each programlisting 
by using the <code class="sgmltag-attribute">language</code> attribute. The <a href="../html/highlight.default.language.html"><em class="parameter"><code>highlight.default.language</code></em></a> 
parameter can be used to specify the language for programlistings without a <code class="sgmltag-attribute">language</code> 
attribute. Syntax highlighting also works for <a href="http://docbook.org/tdg5/en/html/screen.html"><code class="sgmltag-element">screen</code></a> and <a href="http://docbook.org/tdg5/en/html/synopsis.html"><code class="sgmltag-element">synopsis</code></a> elements.</p>

<p>The actual highlighting work is done by the XSLTHL extension module. This is an external Java library that has to be 
downloaded separately (see below).</p>

<div class="itemizedlist"><p>In order to use this extension, you must</p><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>add <code class="filename">xslthl-2.x.x.jar</code> to your Java classpath. The latest version is available
from <a class="ulink" href="http://sourceforge.net/projects/xslthl" target="_top">the XSLT syntax highlighting project</a> 
at SourceForge.</p>
</li><li class="listitem">
<p>use a customization layer in which you import one of the following stylesheet modules: 
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem">
    <p><code class="filename">html/highlight.xsl</code>
    </p>
  </li><li class="listitem">
    <p><code class="filename">xhtml/highlight.xsl</code>
    </p>
  </li><li class="listitem">
    <p><code class="filename">xhtml-1_1/highlight.xsl</code>
    </p>
  </li><li class="listitem">
    <p><code class="filename">fo/highlight.xsl</code>
    </p>
</li></ul></div><p>
</p>
</li><li class="listitem"><p>let either the <code class="literal">xslthl.config</code> Java system property or the
<a href="../html/highlight.xslthl.config.html"><em class="parameter"><code>highlight.xslthl.config</code></em></a> parameter point to the configuration file for syntax 
highlighting (using URL syntax). DocBook XSL comes with a ready-to-use configuration file, 
<code class="filename">highlighting/xslthl-config.xml</code>.</p>
</li></ul></div>

<p>The extension works with Saxon 6.5.x and Xalan-J. (Saxon 8.5 or later is also supported, but since it is 
an XSLT 2.0 processor it is not guaranteed to work with DocBook XSL in all circumstances.)</p>

<p>The following is an example of a Saxon 6 command adapted for syntax highlighting, to be used on Windows:</p>

<div class="informalexample">
<p><span class="command"><strong>java -cp c:/Java/saxon.jar;c:/Java/xslthl-2.0.1.jar 
-Dxslthl.config=file:///c:/docbook-xsl/highlighting/xslthl-config.xml com.icl.saxon.StyleSheet 
-o test.html test.xml myhtml.xsl</strong></span></p>
</div>

</div>
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="table.footnote.number.symbols.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="misc.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="highlight.xslthl.config.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">table.footnote.number.symbols </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> highlight.xslthl.config</td></tr></table></div></body></html>