Creation of a set of layout rules
This page was automatically translated. Stay tuned for a human translation…
XML Editor
By using standard XML (UTF-8), the layout rules can be edited with any text editor.
The supplied XML schemas (RELAX NG and XML Schema (XSD)) make it easy to enter the layout ruleset. Such a schema can be thought of as a computer-readable instruction as to which commands may appear at which position in the layout. The instructions also contain information about the parameters that are permitted in each case. In addition, the scheme also provides help by briefly explaining each command and parameter. In short: if the editor can integrate this schema and also "understands" it, it is an input help that should not be underestimated. You reduce the number of errors and the input time significantly, editing the layout rules starts to be really fun (believe me).
To include this schema, you need to use a suitable XML editor that can process RELAX NG or XML Schemas, e.g:
- OxygenXML (Mac, Windows, Linux)
- Visual Studio Code (Mac, Windows, Linux, free)
The first two editors provide excellent cross-platform support for the schema.
- Atom (Mac, Windows, Linux, free)
- XMLSpy (Windows)
- XML Blueprint (Windows)
- GNU Emacs with nxml-mode (cross platform, free)
- jEdit (Mac, Windows, Linux, free)
The schema files for the layout rules are located in the ZIP file in the share/schema/
directory under the file names
layoutschema-de.rng
layoutschema-en.rng
for RELAX NG and
layoutschema-de.xsd
layoutschema-en.xsd
for XSD, depending on the desired language of the documentation.
For Visual Studio code, the required package is XML (Red Hat), installation instructions are available at https://blog.speedata.de/2019/09/11/xsd-schema/ (German only). For the Atom editor, the package is called language-speedata-publisher
. The installation instructions can be found on the github page at https://github.com/speedata/atom-schema-speedata.
Namespace of the layout ruleset
The XML namespace of the layout ruleset is urn:speedata.de:2009/publisher/en
. The additional XPath functions are in the namespace urn:speedata:2009/publisher/functions/en
. A layout set should therefore always have this frame:
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
...
</Layout>
Then you can call speedata’s own functions with the prefix sd:, for example: sd:current-page()
to determine the current page number.