|GNU/Linux & macOS|
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:
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.
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.
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.
See dedicated page.
XPPq is available on NPM, so you can easily install1) and test it:
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.
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
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 recognized directives are:
bloc. More details can be found on this page, on which you can also find an example of use.
XPPq is developed by Claude SIMON (http://q37.info/contact/).