Introduction:

This connector is used to transform a file. It is a connector allowing to transform a file of another format (CSV, PLAT, - EDIFACT...) to an XML file based using a file called «  format  ».

Icon:

1646134524824-934.png

The connector exists in the scenario panel:

1.png

Configuration:

1646134567096-508.png

- To create or modify a transformation connector, you should be on a scenario (new or existing).

- Configuration :

     FILE_TO_XML is a transformation connector used to set up the connector, you should click on the blue   button above the connector and fill in the properties displayed :

  • Name : To give a name to the processing step (connector). It is very useful to give meaningful names .
  • Format : The XML file allowing to transform the input or output file to XML format or vice versa.  We have several existing standard formats (EDIFACT, X12..)
  • FileName : To give a name to the output file of the current step. This step is very useful for the monitoring of the platform.
  • Input & Output Charset : to precise the encoding for the files. The default encoding is UTF-8.
  • Condition : This field allows you to add a condition to execute the processing step only if the condition is met.
  • Add boundary OnError : It is checked only to add an additional treatment in the case of an error on the treatment step.

Le fichier Format:

The format file is mandatory for the connector to work. The iXPath file formats are described in XML and stored in the client environment's format directory.

The XML format represents the actual hierarchical structure of the file.

The XML output file will strictly use the tag names and structure defined in the XML structure file.

In this chapter we will go through all the possible cases of the format file.

  1. Format Edifact

Introduction:

The Edifact format allows the user to transform an edifact fifile to an xml file respecting.

XML documents must contain one root element that is the parent of all other elements. This element should exist once in all the document. In general it is a node called "ixDOC".

Elements of the file format:

    Any group of information (even those that are not delimited by characters, a line break or other) must be represented in the document (e.g. groups of EDIFACT segments, Messages, etc.).

    Attributes are considered one of the important elements in the format xml file. They tell the translation processor what actions to take when reading the document. They should be defined globally (ixDOC) or individually on each tag.

    All the attributes defined in the "ixDOC" tag will be automatically carried over to all the tags in the format. These are therefore the default attributes. An undefined attribute will take the default value defined in this document. Each attribute should be indicated only if it is really useful. Some attributes can slow down the processing.

Liste des Attributs de Traitement

format

string

Default Value : « none »

Description : Defines how the data will be taken from the file

  • « none »  : Defines a group of information, not delimited.
  • « variable » :Data delimited by one or more characters. The "end" attribute is mandatory for this format.
  • « fixed » :Fixed size data. The « length » attribute is mandatory.

end

string

Default Value : empty

Description : Defines the character or characters delimiting a " variable " format. The characters " \r " (carriage return) " \n " (newline) " \t " (tab), can be used.

length

integer

Default Value : empty

Description : Defines the number of characters to be taken for a structure of type "fixed".

min

integer

Default Value : 0

Description : Défini le nombre minimal d’occurrences successives de cette balise.

max

integer

Default Value : 1

Description : Défini le nombre maximal d’occurrences successives de cette balise. Le caractère « n » peut être utilisé pour indiquer un nombre infini.

doRead

boolean

Default Value : true

Description : Utilisé en lecture seulement. Défini si la balise XML doit être écrite dans le fichier XML produit. Ne pas écrire une balise libère de la mémoire et accélère les traitements. Il devient indispensable d’utiliser cet attribut pour traiter des fichiers de plusieurs centaines de Mo.

skipEmpty

boolean

Default Value : true

Description : En lecture uniquement. Défini si une balise XML vide doit être générée si la donnée est vide dans le fichier source.

errorLevel

boolean

Default Value : false

Description : Lorsque cet attribut est fixé à « true », le traducteur fera une copie du point de lecture. En cas d’erreur, les premiers caractères seront retournés dans le message d’erreur. Il convient de positionner cet attribut à « true » sur les enregistrements ou segments.

key

boolean

Default Value : false

Description : Défini si la donnée est une clé pour son père. La données lu/écrite devra être identique à la valeur présente à l’intérieur de la balise décrite dans le format.

dataPick

boolean

Default Value : true

Description : Pour le format « fixed » uniquement. Défini si la donnée est réellement prélevée.

emptyEnd

boolean

Default Value : false (si la balise a des fils) – true (si la balise n’a pas de fils)

Description : Défini si le séparateur de fin, pour un format « variable », doit être écrit si la donnée est vide.

lastEnd

boolean

Default Value : true

Description : Défini si le séparateur de fin, pour un format « variable », doit être écrit si la donnée est la dernière d’une séquence.

 

Tags:
Created by Assala Chmiti on 2022/03/01 12:21
    
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian