computing:epeios:tools:xppq:home

The Epeios XML preprocessor ('XPPq')

CI xppq-cli on GitHub xppq-java on GitHub xppq-node on GitHub
GNU/Linux & macOS xppq-cli on Travis CI xppq-java on Travis CI xppq-node on Travis CI
Windows xppq-cli on AppVeyor xppq-java on AppVeyor xppq-node on AppVeyor

Introduction

XPPq is a tool from the Epeios project which transforms an XML file to another XML file, following directives inserted directly in the source XML file. This directives allow to handle macros, to affect value to variables and to test their values, to include files… In a glance, XPPq aims to be to XML what cpp is to C/C++.

To achieve this, following directives are available:

  • <xpp:expand href=“file”/> which allows the inclusion of a file,
  • <xpp:define name=“name”>…</xpp:define>, which, in combination with <xpp:expand select=“name”/> allows the definition and expansion of a macro,
  • <xpp:set name=“name” value=“value”/>, which, in combination with <xpp:ifeq select=“name” value=“value”>…</xpp:ifeq> allows the conditional inclusion of an XML tree.

More about this directives and the others can be found in the directives dedicated page.

The preprocessor is also embedded in all the Epeios software which handle XML files. So the xpp directives can also be used for those files.

The default XML namespace: http://q37.info/ns/xpp (xmlns:xpp=“http://q37.info/ns/xpp”).

XPPq works with GNU/Linux (and probably other POSIX compliant operating systems), macOS and Windows, on IA-32, AMD64 and ARM (AArch32 and AArch64, like those on Raspberry Pi, Banana Pi, ODROID… devices) architectures.

XPPq handles 8-bits encoded files, and also UTF-8 encoded files, with or without BOM. All included files (using the expand directive) have to use the same encoding as the file which includes them.

Installation

For the Node.js version, simply launch npm install xppq.

The Windows binaries are available in the releases section of the Github repository.

See also the compilation related page.

Configuration

The default namespace is xppq, but it can be changed by setting the Parameters/Namespace entry in the configuration file (the .xcfg suffixed file), or with the -n|--namespace argument for the command-line version of XPPq (launch xppq --help for more details).

See also the configuration related page.

Usage

CLI version

Node.js version

XPPq is available on NPM, so you can easily install1) and test it:

XPPq on NPM

This package, in addition of the XML preprocessor, also provides an XML parser.

Once installed, you can test it by launching npm explore xppq -- node test.js.

You can also take a look to this file for examples of use of xppq-node, and test them online on Runkit, where you can also test xppq-node with your own scripts.

Java version

This version of XPPq is subject to change, and this page will then be modified accordingly. In the meantime, you can take a look here

Licences

XPPq is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Other rights can be granted, but only by an explicitly written permission from the author of XPPq.

The directives

The recognized directives are: define, expand, attribute, set, ifeq, cdata and bloc. More details can be found on this page, on which you can also find an example of use.

Author

XPPq is developed by Claude SIMON (http://q37.info/contact/).

Resources

1) Except under Windows, you will need a C++ compilation environment.
computing/epeios/tools/xppq/home.txt · Last modified: Fri Sep 15 10:18:19 2017 (15/09/17) by Claude SIMON