<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 2. Saxon Extensions</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.37"><link rel="home" href="index.html" title="DocBook XSL Stylesheet Documentation"><link rel="up" href="index.html" title="DocBook XSL Stylesheet Documentation"><link rel="previous" href="ch01s04.html" title="Customizing DocBook XSL stylesheets"><link rel="next" href="ch02s02.html" title="Using the Extensions"></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">Chapter 2. Saxon Extensions</th></tr><tr><td width="20%" align="left"><a href="ch01s04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a href="ch02s02.html">Next</a></td></tr></table><hr></div><p>Beginning with release 1.25, the DocBook XSL Stylesheets include
a set of Java extensions for Saxon.</p><p>These extensions enable callouts, numbered program listings, and
the direct inclusion of text:</p><div class="programlistingco"><pre class="programlisting">@rem = '--*-Perl-*--
@echo off
perl.exe %_batchname %$
goto endofperl
@rem ';
# Compress mail...
require 'n:/home/nwalsh/lib/cygnus.pl';
require 'timelocal.pl';
use Cwd;
select (STDERR); $| = 1;
select (STDOUT); $| = 1;
@DIRS = ("/home/nwalsh/Mail");
while (@DIRS) {
$dir = shift @DIRS;
opendir (DIR, $dir);
while ($fname = readdir(DIR)) {
$file = "$dir/$fname";
next if ! -d $file;
next if $fname =~ /^\.\.?$/;
print "$file\n";
push (@DIRS, $file);
&compress ($file);
}
}
exit;</pre><div class="calloutlist"><a name="c44b1b4b5b3"></a><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><a name="c44b1b4b5b3b1"></a><img src="../images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The prologue handles embedding a Perl script in a DOS batch file.</p></td></tr><tr><td width="5%" valign="top" align="left"><a name="c44b1b4b5b3b2"></a><img src="../images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>The <tt>goto</tt> statement, interpreted by the DOS batch
file interpreter, skips over the body of the Perl script.</p></td></tr><tr><td width="5%" valign="top" align="left"><a name="c44b1b4b5b3b3"></a><img src="../images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>The <tt>require</tt> statement sources in external program
fragments.</p></td></tr><tr><td width="5%" valign="top" align="left"><a name="c44b1b4b5b3b4"></a><img src="../images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>The <tt>use</tt> statement is similar, but has additional
utility. It is a Perl5 function. (Note that this callout area specifies
both a line and a column.)</p></td></tr><tr><td width="5%" valign="top" align="left"><a name="c44b1b4b5b3b5"></a><img src="../images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>This is a user subroutine call.</p></td></tr></table></div></div><p>The extensions are included in the distribution in
<tt>extensions/nwalsh.jar</tt>. Just make sure that jar
file is in your CLASSPATH when you run Saxon.</p><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a href="ch01s04.html">Prev</a> </td><td width="20%" align="center"><a href="index.html">Home</a></td><td width="40%" align="right"> <a href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left">Customizing DocBook XSL stylesheets </td><td width="20%" align="center"><a href="index.html">Up</a></td><td width="40%" align="right"> Using the Extensions</td></tr></table></div></body></html>