MakeAIP.bat is a batch script for Windows NT/2000. It eases production of eAIP related files, that is conversion of eAIP in XML format to HTML, XSL-FO and PDF.
MakeAIP.bat shall be considered as a proof of concept only. No effort was spent on fine-tuning the tool for better performance. There was no formal validation (software audit) of the HTML and PDF output, to prove that it corresponds at 100% to the content of the XML files. The tool should be revisited, improved and validated before being used in a production environment
This documentation applies to MakeAIP.bat version 2.5, revision 1.12, but it is not complete: more parameters are explained in AMDT procedures.
Table 3.1.
MakeAIP.bat | Main file, which you use for any command |
doc\MakeAIP.html | This file: the documentation |
tools\MakeAIP\FOP.bat | Batch file for FOP |
tools\MakeAIP\msxsl.bat | Batch file for msxsl.exe |
tools\MakeAIP\saxon.bat | Batch file for Saxon |
tools\MakeAIP\xalan.bat | Batch file for Xalan |
tools\MakeAIP\XEP.bat | Batch file for XEP |
tools\MakeAIP\xt.bat | Batch file for XT |
html\ | Directory where HTML files are generated |
fo\ (must be created) | Directory where XSL-FO files are generated |
pdf\ (must be created) | Directory where PDF files are generated |
The file saxon.bat is pre-configured to work with Saxon 6.5.2, provided with the eAIP package.
Open a command prompt window ("MS-DOS")
Change directory to where you installed the eAIP package
Then you can simply type makeaip.bat to display a summary of usage information.
Tip: Microsoft offers several "power toys" for their various Windows versions. One of them, called "Command Prompt Here" will prove very useful, as it allows to start a command prompt window from File Explorer, directly in a specific directory, by right-clicking on a directory entry. It is available at http://www.microsoft.com/ntworkstation/downloads/PowerToys/Networking/NTComPrompt.asp, for Windows NT4. It exists for other Windows versions as well.
MakeAIP.bat accepts several parameters, but only the first one is mandatory. A complete command line looks like this:
makeaip target -f format -d directory -l language -c country -p XSLT_processor -r XSL-FO_renderer
where:
target is mandatory and is one of the following:
sections: generate all eAIP sections such as GEN-2.2, ENR-3.1 and AD-2.EADD
menu: generate the navigation menu in HTML (the left frame), for html format only
all: generate all the above, for html format only
a part, chapter or section name such as GEN-2.2: generate only the specified section
an eAIC or eSUP name such as eSUP-2001-01-01 or eAIC-2001-01-01
validator: report any DTD validation errors and run MakeAIP schematron (see below)
schematron: generates a Schematron report of Additional Rules validation (see eAIP Specification)
checklist: generates a complete GEN-0.4 in XSL-FO format (needs -f fo and -s with URI of AT directory)
amdt_pages: used for paper AMDT production (see AMDT procedures)
format is one of the following:
html: convert eAIP from XML to HTML
fo: convert eAIP from XML to XSL-FO; see notes below
pdf: convert eAIP from XSL-FO to PDF; see notes below
directory is the directory where the eAIP XML file to convert resides
language is the target language (your eAIP can be in several language, identified by the suffix to the eAIP XML file, as in EC-eAIP-en-GB.xml)
country is the ICAO country code (in case you have several eAIPs from different countries; identified by the prefix to the eAIP XML file, as in EC-eAIP-en.xml)
XSLT_processor is one of the following: "saxon", "xalan", "msxsl", "xt" (without the quotes)
XSL-FO_renderer is one of the following: "FOP", "XEP" (without the quotes)
Validator: the validator does not convert the eAIP in any format. Instead, it tries to validate the eAIP, first against the declared DTD, then against the "additional rules". The directory, language and country parameters are recognised by the Validator, not the others.
The PDF format is generated using the XSL-FO format. If the XSL-FO does not exist yet, MakeAIP.bat will generated it for you. Note: there is currently a bug which prevents this from working properly, so you will need to run MakeAIP separately for each format: fo, at and pdf successively. If it does exist, then it will be used. This means that if you update the XML source, you will have to either delete previously generated XSL-FO files, or re-generate them yourself with the "-f fo" option.
When generating XSL-FO and PDF formats, you should take care of specifying your renderer for both formats, as the XSL-FO files will be slightly different depending on the -r option.
When we write about "sections" in this document, we always mean a 3rd-level element in the eAIP document structure. Parts (GEN, ENR, AD) are the first level, chapters (GEN-2, AD-3, etc.). The third level includes all sections in GEN, ENR, AD-0 and AD-1, and all aerodromes and heliports. It does not include sections in aerodromes and heliports
Command:
makeaip all
Result: all chapter files in HTML are created, plus the navigation menu, in the directory html\
Command:
makeaip ENR-0.1
Result: the file EC-ENR-0.1-en-GB.html is created in the directory html\
Command:
makeaip ENR-0.1 -f pdf
Result: the file EC-ENR-0.1-en-GB.fo is created in the directory fo\ and the file EC-ENR-0.1-en-GB.pdf is created in the directory pdf\
Command:
makeaip ENR-0.1 -f pdf -l nl -c EH
Result: the file EC-ENR-0.1-en-GB.pdf is created in the directory pdf\
Command:
makeaip ENR-0.1 -f pdf -p msxsl -r XEP
Result: the file EC-ENR-0.1-en-GB.fo is created in the directory fo\ and the file EC-ENR-0.1-en-GB.pdf is created in the directory pdf\
Command:
makeaip validator
Result: MakeAIP calls an XML parser to validate the eAIP against the DTD and then it calls an XSLT processor to validate against the additional rules
When a program called by MakeAIP terminates with a proper error code, MakeAIP will ask the user if it should continue. At that time, one can press ctrl-C to stop MakeAIP or any other key to continue. This can be useful when generating all sections: the generation can take a couple of minutes, and a lot of information is output to the screen, so it is difficult to know if each file were generated without error.
This behaviour can be switched off: look at the last few lines of MakeAIP.bat.
Before using MakeAIP.bat, you should certainly configure it. There are 2 aspects to configure: the defaults parameters and the location and parameters of XSLT and XSL-FO processors.
MakeAIP.bat command line parameters can be set to default values, so that you don't need to specify them at each use:
Table 3.2.
Command line option | Signification | Initial value | Other possible values |
---|---|---|---|
-f | output format | html | fo, pdf |
-d | eAIP directory | eAIP | any |
-l | language | en-GB | any |
-c | ICAO country code | EC | any |
-p | XSLT processor | saxon | xalan, msxsl, xt |
-r | XSL-FO renderer | XEP | FOP |
To change the default values, edit MakeAIP.bat in a text editor such as Notepad, locate the section "Set defaults" near the top of the file and edit the parameters as you wish. Note that some parameters only accept a limited list of values.
We provide ready-made batch files for Saxon, Xalan, msxsl.exe, xt, FOP and XEP.
Saxon.bat is already configured to work with the supplied saxon.jar binary. Please note that we only provide this binary file and not the whole Saxon distribution, in order to save space. The complete distribution is available at http://saxon.sourceforge.net/, including documentation and source code.
You need to edit these files (or at least those for the processors/renderers that you will use) with a text editor in order to specify the location of these programs, or more generally, how you want them to be executed. If you followed a standard installation procedure for each of them, the only thing you probably need to change is their home directory. To configure XEP, you might also need to change the name of XEP's jar file, which depends on the version you are using (client, server, etc.). Refer to XEP's own batch files for an example.
These batch scripts always take the same set of parameters:
For XSLT processors (xalan.bat, msxsl.bat, xt.bat):
xxx.bat XML XSLT OUTPUT param1-name param1-value param2-name param2-value param3-name param3-value
where:
XML is the source XML file;
XSLT is the style sheet to use;
OUTPUT is the resulting file (html or fo);
paramX-name and -value are optional XSLT parameters name/value pairs
For XSL-FO renderers (FOP.bat, XEP.bat):
xxx.bat FO OUTPUT
where:
FO is the source XSL-FO file;
OUTPUT is the resulting file (pdf)
The validator.bat file is different from the others. It first calls a parser to validate the eAIP XML file. This validation is done in the classic XML meaning: the XML file is validated against the DTD that it declares.
Then, validator.bat calls MakeAIP schematron, which runs an XSLT processor to produce a Schematron validation report. This validates the eAIP against the Additional Rules.
You can also use other processors: there are many other XSLT processors and FO renderers. To do that, simply copy an existing batch file, rename it and edit it following the program's command line syntax. Then, edit MakeAIP.bat and add your program's name to the variable xsltproc_list (for an XSLT processor) or foproc_list (for an XSL-FO renderer) in the section "CONFIGURATION". Note that the program name you choose should only contain letters and numbers (no space or other special character).