Chapter 5. MakeAIP-core.bat Documentation

Introduction

MakeAIP-core.bat is a batch script for Windows NT/2000/XP. It eases production of eAIP related files, that is conversion of eAIP in XML format to HTML, XSL-FO and PDF.

Note

MakeAIP-core.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 entirely with 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-core.bat version 2.6, revision 1.25, but it is not complete: more parameters are explained in AMDT procedures.

Files

Table 5.1. 

MakeAIP-core.batMain file, which used for any command
doc\MakeAIP-core.htmlThis file: the documentation
tools\MakeAIP-core\msxsl.batBatch file for msxsl.exe
tools\MakeAIP-core\saxon.batBatch file for Saxon
tools\MakeAIP-core\xalan.batBatch file for Xalan
tools\MakeAIP-core\xt.batBatch file for XT

The file saxon.bat is pre-configured to work with Saxon, provided with the eAIP Core Toolbox.

Usage

  1. Open a command prompt window ("MS-DOS");

  2. Change the directory to the one where the eAIP Core Toolbox is installed.

Then simply type makeaip-core.bat to display a summary of usage information, or use one of the sub-commands described below.

Note

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 the launch of a command prompt window from File Explorer, directly in a specific directory, by right-clicking on a directory entry. For Windows XP, it is available at http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx.

Command-line Parameters

Conventions Used in this Document

Throughout this document the following syntax will be used to describe the command-line commands:

command { option1 | option2 } {mandatory_parameter replaceable_value} [optional_parameter replaceable_value] [other_optional_parameter value]

command

The batch file or executable file to execute.

options

Alternatives are separated by a vertical bar. Alternatives may be straight values or replaceable values.

parameters

Parameters brackets indicate if the parameter is optional or mandatory.

replaceable_value

Most parameters take an argument, the styling of which indicates that the word should be replaced by an actual value. The possible values are then explained in the command summary.

value

Fixed values (for a given command) have a different format. These indicate the actual value that must be typed for the command.

MakeAIP-core Command General Synopsis

MakeAIP-core.bat accepts several parameters. All parameters are optional and running MakeAIP-core without any parameter outputs a short usage summary.

If any parameter is entered, then the target parameter is mandatory: it indicates the sub-command to run. Depending on the target, other parameters may subsequently become mandatory as well. Here is the command synopsis for general parameters:

makeaip-core { sub-command | section_id | AIC_or_SUP_name } [parameters...]

where:

Common Parameters

The following parameters are used for several sub-commands:

-d directory

Directory where the eAIP XML file is located. The eAIP XML file must be named XX-eAIP-yy-YY.xml, where XX is the country code and yy-YY the language code.

-s directory

Directory where source (input) files to the sub-command are located.

-t directory

Directory where target (output) files from the sub-command will be created.

-l language

Language selection (your eAIP may be in several languages, identified by the suffix to the eAIP XML file, as in EC-eAIP-en-GB.xml).

-c country

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).

-p XSLT_processor

Replace XSLT_processor with one of the following: "saxon", "xalan", "msxsl", "xt" (without the quotes).

-debug

Useful for debugging stylesheets or MakeAIP-core itself, by providing additional output messages.

AIP Section Publication

This is the general process when an editor wishes to generate an AIP section in HTML.

HTML Format

makeaip-core { section_id } [-d eAIP_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates a single HTML file for the eAIP element with the given id. The file will be named XX-section_id-yy-YY.html, where XX is the country code and yy-YY the language code.

section_id

The value of the id attribute of an eAIP element. The element must be a part-, chapter- or section-level element, or an Aerodrome or Heliport element.

Example 5.1. MakeAIP-core section_id sub-command for HTML format

Generate one HTML file named EC-GEN-en-GB.html for the whole GEN part:

makeaip-core GEN -d ..\..\Operations\2004-10-28\eAIP -t ..\..\Operations\2004-10-28\html\eAIP

Generate one HTML file named EB-ENR-3-fr-FR.html for the whole ENR 3 chapter:

makeaip-core ENR-3 -d ..\..\Operations\2004-10-28\eAIP -t ..\..\Operations\2004-10-28\html\eAIP -c EB -l fr-FR

Generate one HTML file for the whole AD 1.3 section:

makeaip-core AD-1.3 -d ..\..\Operations\2004-10-28\eAIP -t ..\..\Operations\2004-10-28\html\eAIP

Generate one HTML file for the whole EADD Aerodrome:

makeaip-core AD-2.EADD -d ..\..\Operations\2004-10-28\eAIP -t ..\..\Operations\2004-10-28\html\eAIP


Circulars and Supplements

Generating a Supplement or Circular is very similar to generating an eAIP section. Simply replace the eAIP section id by the document name.

Warning

A limitation of MakeAIP-core's command-line syntax means that the names of all Supplements and Circulars begin with eSUP and eAIC respectively. Other eAIP publication tools may remove this limitation.

Example 5.2. MakeAIP-core AIC_or_SUP_name sub-command for PDF format

Generate one HTML file for a Supplement:

makeaip-core eSUP-2001-02 -d ..\..\Operations\2004-10-28\eSUP -t ..\..\Operations\2004-10-28\html\eSUP

Generate one AT file for the whole ENR 3.1 section, without Amendment indications (the PDF file is normally not produced in this case, but it can be generated if needed):

makeaip-core ENR-3.1 -f fo -d ..\..\Operations\2004-10-28\eAIP -t ..\..\Operations\2004-10-28\without-amdt-info -a false

makeaip-core ENR-3.1 -f at -s ..\..\Operations\2004-10-28\without-amdt-info -t ..\..\Operations\2004-10-28\without-amdt-info


eAIP HTML Interface

The eAIP has a convenient HTML interface to browse the information it contains. This section describes the MakeAIP-core commands to generate the following components of this interface:

MakeAIP-core Menu

makeaip-core {menu} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the AIP table of contents in the file XX-menu-yy-YY.html, where XX is the country code and yy-YY the language code. If there is no Amendment in the eAIP, a table of contents will be generated anyway, based on the previous AIP indicated in the eAIP. For more information, refer to the How to Create an eAIP.

source_directory

Path to the directory where the eAIS-package.xml file is located.

Example 5.3. MakeAIP-core menu sub-command

makeaip-core menu -s ..\..\Operations\2004-10-28 -t ..\..\Operations\2004-10-28\html\eAIP


MakeAIP-core AMDT

makeaip-core {AMDT} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the list of changes, for the current AIP Amendment, in the file XX-AMDT-yy-YY.html, where XX is the country code and yy-YY the language code. If there is no Amendment in the eAIP, the file will contain an explanatory note.

source_directory

Path to the directory where the eAIS-package.xml file is located.

Example 5.4. MakeAIP-core AMDT sub-command

makeaip-core AMDT -s ..\..\Operations\2004-10-28 -t ..\..\Operations\2004-10-28\html\eAIP


MakeAIP-core eSUPs

makeaip-core {eSUPs} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the list of AIP Supplements in force in the file XX-eSUPs-yy-YY.html, where XX is the country code and yy-YY the language code.

source_directory

Path to the directory where the eAIS-package.xml file is located.

Example 5.5. MakeAIP-core eSUPs sub-command

makeaip-core eSUPs -s ..\..\Operations\2004-10-28 -t ..\..\Operations\2004-10-28\html\eSUP


MakeAIP-core eAICs

makeaip-core {eAICs} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the list of Circulars in force in the file XX-eAICs-yy-YY.html, where XX is the country code and yy-YY the language code.

source_directory

Path to the directory where the eAIS-package.xml file is located.

Example 5.6. MakeAIP-core eAICs sub-command

makeaip-core eAICs -s ..\..\Operations\2004-10-28 -t ..\..\Operations\2004-10-28\html\eAIC


MakeAIP-core Cover

makeaip-core {cover} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the eAIP cover page in the file XX-cover-yy-YY.html, where XX is the country code and yy-YY the language code.

source_directory

Path to the directory where the eAIS-package.xml file is located.

Example 5.7. MakeAIP-core eAICs sub-command

makeaip-core cover -s ..\..\Operations\2004-10-28 -t ..\..\Operations\2004-10-28\html


MakeAIP-core History

makeaip-core {history} [-s source_directory] [-t target_directory] [-l language] [-c country-code] [-p XSLT_processor]

Generates the list of published eAIPs in the file XX-history-yy-YY.html, where XX is the country code and yy-YY the language code. This file must be re-generated each time a new eAIP is published. The newly-generated file replaces the previous one.

source_directory

Path to the directory where the file eAIS-packages.xml, containing the list of published eAIPs in XML format, is located.

Example 5.8. MakeAIP-core eAICs sub-command

makeaip-core history -s ..\..\Operations -t ..\..\Operations


eAIP For EAD/PAMS

An eAIP prepared for the European AIS Database (EAD) (more precisely, for the Published AIP Management System (PAMS)) needs a file named packmap.xml. For more information about this file, please see eAIP for EAD PAMS.

makeaip-core {packmap} [-s source_directory] [-p XSLT_processor]

Generates the packmap.xml file for the eAIS description file found in the source directory. The generated file is saved in the source directory.

source_directory

Path to the directory where the file eAIS-package.xml is located.

Example 5.9. MakeAIP-core eAICs sub-command

makeaip-core packmap -s ..\..\Operations\2004-10-28


Validation Sub-Commands

More information about validation can be found in the eAIP Validation chapter .

MakeAIP-core Validator

makeaip-core {validator} [-d eAIP_directory] [-l language] [-c country-code]

The validator does not convert the eAIP into any format. Instead, it validates the eAIP against the declared DTD.

MakeAIP-core schematron

makeaip-core {schematron} [-d eAIP_directory] [-l language] [-c country-code]

The schematron sub-command validates an eAIP against the additional rules. The validation result is output in the tools\validator directory.

Errors during Execution

When a program called by MakeAIP-core terminates with a proper error code, MakeAIP-core will ask the user if it should continue. At that time, one can press ctrl-C to stop MakeAIP-core 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 is generated without error.

This functionality can be switched off: refer to the last few lines of MakeAIP-core.bat.

Configuration

Before using MakeAIP-core.bat it should be configured. There are two aspects to configure: the defaults parameters and the location and parameters of the XSLT processors.

Default Parameters

MakeAIP-core.bat command line parameters can be set to default values, so that you do not need to specify them at each use:

Table 5.2. 

Command line optionSignificationInitial valueOther possible values
-deAIP directoryeAIPany
-llanguageen-GBany
-cICAO country codeECany
-pXSLT processorsaxonxalan, msxsl, xt

To change the default values, edit MakeAIP-core.bat in a text editor such as Notepad, locate the section "Set defaults" near the top of the file and edit the parameters as required. Note that some parameters only accept a limited set of values.

XSLT Processors

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 in order to save space only this binary file is provided and not the whole Saxon distribution. The complete distribution is available at http://saxon.sourceforge.net/, including documentation and source code.

These files (or at least those for the processors/renderers that you will use) need to be edited with a text editor in order to specify the location of these programs, or more generally, how they should be executed. If a standard installation procedure is followed for each of them, their home directory is probably the only change required. To configure XEP, you may 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 stylesheet to use;

    • OUTPUT is the resulting file (html or fo);

    • paramX-name and -value are optional XSLT parameters name/value pairs.

XSL-FO processors

Ready-made batch files for Saxon, Xalan, msxsl.exe, xt, FOP and XEP are provided.

Saxon.bat is already configured to work with the supplied saxon.jar binary. Please note that only the binary file is provided 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.

These files need to be edited (or at least those for the processors/renderers that will be used) with a text editor in order to specify the location of these programs, or more generally, how they should be executed. If a standard installation procedure for each of them was followed, the only their home directory may need changing. To configure XEP, the name of XEP's jar file may need changing which depends on the version being used (client, server, etc.). Refer to XEP's own batch files for an example.

These batch scripts always take the same set of parameters:

  • 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).

Validator and Schematron

The validator.bat file is different to 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.

Schematron.bat runs an XSLT processor to produce a Schematron validation report. This validates the eAIP against the Additional Rules.

Advanced Configuration

Other processors may also be used: there are many other XSLT processors. To do this, simply copy an existing batch file, rename it and edit it following the program's command line syntax. Then, edit MakeAIP-core.bat and add your program's name to the variable xsltproc_list (for an XSLT processor) in the section "CONFIGURATION". Note that the program name you specify should only contain letters and numbers (no spaces or other special characters).



[1] These sub-commands generate components of the eAIP HTML interface. See also the eAIP Editor's Manual.