Generic XML file information - LabelHub/labelhub.integration.documentation GitHub Wiki
XML files need to have a single root element and in the case of integration with LabelHub the naming of the root element is used to determin what type of entity is in the file. Currently these rootnames/entities are valid:
- brandowner
- die
- label
- material
- lacquer
- imposition
The encoding in the prolog-element is used to determin the encoding for the import. It is highly recommended to use UTF-8 as encoding since it is the only one LabelHub official support.
Sample of XML-file format illustrating the prolog and a die rootelement
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<die version="3">
...
</die>
LabelHub uses a versioning system of the XML-structure to make integrations more resilient. A new version is introduced when a breaking change are made, eg. renaming a field. The versioning is done via the version-attribute on the root element. Each entity type has it's own series of versionnumbers, here is the latest version numbers for each entitytype:
EntityType | Latest version |
---|---|
brandowner | 1 |
die | 3 |
label | 6 |
lacquer | 2 |
material | 2 |
imposition | 1 |
It is always recommended to use the latest version, but older versions will be kept working as long as possible(and as long as someone uses them). If a very old version is used LabelHub might contact you and help you upgrade to a newer version.
Some entities uses floating point numbers and in order to ease formatting of those, it is possible to override decimal- and/or thousandsseperators. This is also done as an attribute on the root element.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<label version="3" decimalsep="," thousandsep="." >
...
<width>117,5</width>
...
<labelsForward>1.000</labelsForward>
...
</label>
The default decimal seperator is a period/full stop. The default thousandsseperator is none/empty. An example of a default number would be 1234.56
.
If possible it is recommended to use the default and not override the seperators.
The name of the files sent to LabelHub does not have any technical effect on the import itself. The only requirment is that the files have the .xml
-extension. However, it is our experience that naming the file with the pattern {entityType}_{primarykey}.xml
(eg. label_1234.xml
) makes things easy to debug in case of issues. Another option is to add a timestamp to make them unique (eg. {entityType}_{primarykey}_{epochtimestamp}.xml
=> label_1234_1646736715.xml
).
If possible it is recommended to use add some sort of random number or timestamp to the end of the filenames to make sure they are unique.