Running CRexsel from the Command Line
The command line using 'crexsel' is the recommended way to run Rexsel. It can also, therefore, be used in
conjunction with a build system, such as Apache Ant (which is how it is used when building this web site).
Synopsis
crexsel ( [<inputs> ...] [--dest <destination folder>] [--force] [--symbols] [--errors]
[--undefined] [--lineNumbers] [--noXmlnsPrefix] [--verbose] [--debug] )
| ( [<inputs> ...] [--uncompile] )
| ( (-h|--help)] )
Description
The crexsel command invokes the RexselKernel on a list of input files. Each input file should have the
extension "rxsl". The XSL output is sent to an output file in the same directory with the same name as the input
but with the "xsl" extension.
The options that 'crexsel' understands:
-h | --help
|
Show the full help. All other options on the command tail are ignored. |
-l |
--lineNumbers
|
Show source line number comments interleaved in the output XSL. |
-n |
--noXmlnsPrefix
|
Do not use "xsl:" prefix for XSL tags. The default name space for the document is considered to be "http://www.w3.org/1999/XSL/Transform". |
-s |
--symbols
|
Output the symbol table as a comment at the head of the XSL output. If the verbose flag is set this is repeated on the
console. |
-f |
--force
|
Always compile (ignore caching). |
-d | --dest
<dest>
|
Destination folder to receive compiled files. |
-u |
--undefined
|
Output the undefined variables with the errors. |
-e | --errors
|
Show the error list as a comment at the head of the XSL output. If the verbose flag is set the output is also sent to the
console. |
-v |
--verbose
|
Output all messages on the console. |
-d | --debug
|
Major debugging messages — avoid. |
--uncompile
|
Invoke the translation of existing XSLT files into \Rexsel\ files. |
Arguments
Input Files
Will translate all files with the extension 'rxsl' in the current folder, and the output files will be to
'xsl' in the same folder. The operation is carried out silently with no output to the console.
Help
~ % crexsel -h
OVERVIEW: CRexsel V1.1.1 (Kernel V1.1.15)
Translates Rexsel files to XSLT and vice versa.
USAGE: If there has been no change in the rexsel source file then the compiling is skipped
for that file. This can be overridden by using the "-f" flag.
# Compile all files with extension rxsl with errors/symbols in the output.
crexsel *.rxsl --errors --symbols
# Convert all files with extension xsl to Rexsel language files.
crexsel *.xsl --uncompile
# Compile all files with extension rxsl leaving result in parent folder.
crexsel *.rxsl --dest ..
# Force compile (no caching) all files with extension rxsl leaving result in parent folder.
crexsel *.rxsl --dest .. -f
ARGUMENTS:
<inputs> Set of Rexsel files to compile to XSLT.
OPTIONS:
-d, --dest <dest> Destination folder for output files.
-f, --force Force compile (no caching).
-s, --symbols Generate symbol table in the code.
-e, --errors Show error list in output.
-u, --undefined Show undefined errors (ignore external defines).
-l, --lineNumbers Insert Rexsel source line numbers in XSL.
-n, --noXmlnsPrefix No xsl namespace prefix.
--uncompile Transform XSLT file into Rexsel.
--verbose Verbose console messages.
--debug Output debug messages.
-h, --help Show help information.
~ %
Running CRexsel from Ant Build Files
The Ant extract below is from the Ant build file for this web site. It shows how the 'crexsel' command can be
incorporated into the build process.
<project>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/Library/Java/Extensions/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
...
<for param="fileName">
<path>
<fileset dir="${theSourceFolder}/rexsel" includes="*.rxsl"/>
</path>
<sequential>
<echo message="${thisIndent} Compiling @{fileName}"/>
<exec executable="/usr/local/bin/crexsel" dir="${theSourceFolder}/rexsel" output="report.txt">
<arg value="@{fileName}"/>
<arg value="-d"/>
<arg value="${theSourceFolder}"/>
<arg value="-e"/>
</exec>
</sequential>
</for>
Copyright 2025 Hugh Field-Richards. All Rights Reserved.