InforPreParser2

Configuration file

None.

Class name

com.ebd.hub.datawizard.parser.InforPreParser2

Description


There is a special XML data format to exchange data with the ERP system Infor AS. This format can be parsed, after importing the structure from the XSD schema definition, but it only contains the XML tags <STRUCTURE …> and <FIELD …>. All data segments are represented as STRUCTURE tags and all fields as FIELD tags. The name of a field, and therefore its meaning, is only determined by its XML attributes. This means that a classification of field values by field names is not possible in the parsing process, as it is done for all other formats. In order to avoid this situation, the InforPreParser2 can be used.

The InforPreParser2 replaces the elements <STRUCTURE …> and <FIELD …>, as well as the corresponding closing tags.

<STRUCTURE name="XYZ"…>…</STRUCTURE> is replaced by <STRUCTURE_XYZ>…</STRUCTURE_XYZ>.
<FIELD name="ABC" …>…</FIELD> is replaced by <ABC>…</ABC>.

All attributes except name are removed during that replacement process. Other XML elements (and text), not matching any of both replacement patterns, remain unchanged. If the name attribute contains a $, then $ is replaced by _.

Special fields:

If the FIELD element has an attribute name="CONST", the element name is replaced by <CONST_n>, with n as integer starting with 1 and incremented successively beneath superordinate <STRUCTURE…> elements. If the name attribute in FIELD elements starts with TEXT and this name is repeated in successive field elements, then starting from the first repetition an index number (starting with 2) is appended.