<chapter>
<title>Extensions</title>
<?dbhtml filename="extensions.html"?>

<para>Extensions are supported in recent releases of Saxon and Xalan.</para>

<para>These extensions enable callouts, numbered program listings, and
the direct inclusion of text:</para>

<programlistingco>
<areaspec>
<area coords="1" id="prologue"/>
<area coords="4" id="skipeof"/>
<areaset coords="" id="xreq">
<area coords="9" id="require1"/>
<area coords="10" id="require2"/>
</areaset>
<area coords="11 12" id="use"/>
<area coords="27" id="funccall"/>
</areaspec>
<programlisting linenumbering='numbered'>@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);
        &amp;compress ($file);
    }
}

exit;</programlisting>
<calloutlist>
<callout arearefs="prologue">
<para>The prologue handles embedding a Perl script in a DOS batch file.</para>
</callout>
<callout arearefs="skipeof">
<para>The <literal>goto</literal> statement, interpreted by the DOS batch
file interpreter, skips over the body of the Perl script.</para>
</callout>
<callout arearefs="require1">
<para>The <literal>require</literal> statement sources in external program
fragments.</para>
</callout>
<callout arearefs="use">
<para>The <literal>use</literal> statement is similar, but has additional
utility.  It is a Perl5 function.  (Note that this callout area specifies
both a line and a column.)</para>
</callout>
<callout arearefs="funccall">
<para>This is a user subroutine call.</para>
</callout>
</calloutlist>
</programlistingco>

<section>
<title>Saxon Extensions</title>

<para>The DocBook XSL Stylesheets include a set of Java extensions for
Saxon.</para>

<section><title>Installation</title>

<para>The extensions are included in the distribution in
<filename>extensions/saxon642.jar</filename> and
<filename>extensions/saxon643.jar</filename>. Use the former for Saxon
version 6.4.2 and the latter for Saxon 6.4.3 or Saxon 6.4.4.  Saxon
version 6.4.1 and all prior releases contained a significant bug, they
are not supported.</para>

<para>Just make sure that the right jar file is in your CLASSPATH when
you run Saxon.</para>

</section>

<section><title>Using the Extensions</title>

<para>For compatibility with other processors, the extensions are disabled
by default. To enable the extensions, turn on
<literal>$saxon.extensions</literal>, for example by passing
<literal>saxon.extensions=1</literal> to Saxon.</para>

<para>For more control over the specific extensions, see
<olink type="title" localinfo="html/param.html"
                    targetdocent="html-param.xml"/>.</para>
</section>
</section>

<section>
<title>Xalan Extensions</title>

<para>The DocBook XSL Stylesheets include a set of Java extensions for
XalanJ version 2. Extensions are not provided for XalanC at this time.</para>

<section><title>Installation</title>

<para>The extensions are included in the distribution in
<filename>extensions/xalan2.jar</filename>.
Xalan 1 is not supported.</para>

<para>Just make sure that the jar file is in your CLASSPATH when
you run Xalan.</para>

</section>

<section><title>Using the Extensions</title>

<para>For compatibility with other processors, the extensions are disabled
by default. To enable the extensions, turn on
<literal>$xalan.extensions</literal>, for example by passing
<literal>-PARAM xalan.extensions 1</literal> to Xalan.</para>

<para>For more control over the specific extensions, see
<olink type="title" localinfo="html/param.html"
                    targetdocent="html-param.xml"/>.</para>
</section>
</section>

</chapter>
