IPWorks EDI 2020 Python Edition

Questions / Feedback?

translate Method

Translates the specified data.

Syntax

def translate() -> None: ...

Remarks

This method translates the specified data.

The class will convert a document from the format specified by input_format to the format specified by output_format. In practice this allows for converting to XML or JSON from EDI and vice versa.

Before translating from EDI to XML or JSON it is recommended to load a schema using the load_schema method. This ensures additional information can be included in the XML or JSON document. If a schema is specified the XML or JSON will include types and descriptions as element attributes which are useful for interpreting the data.

EDI elements may optionally be renamed when creating XML. To define how an element is renamed add a renaming rule by calling add_renaming_rule.

After calling on_translate the resulting output will contain the EDI, XML or JSON data as defined by output_format. If the output data is XML the export_xml_schema method may be called to export a schema (.xsd) defining the structure of a valid XML document. XML documents which adhere to this document may be translated from XML to EDI.

Input and Output Properties

The class will determine the source and destination of the input and output based on which properties are set.

The order in which the input properties are checked is as follows:

When a valid source is found the search stops. The order in which the output properties are checked is as follows:

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Python Edition - Version 20.0 [Build 8203]