IPWorks EDI 2020 ActiveX Edition

Questions / Feedback?

TRADACOMSTranslator Control

Properties   Methods   Events   Configuration Settings   Errors  

The TRADACOMSTranslator control is optimized for TRADACOMS translation, providing a simple way to convert TRADACOMS documents to and from XML or JSON.

Syntax

TRADACOMSTranslator

Remarks

The control provides a way to convert TRADACOMS to XML or JSON and vice versa.

Getting Started

The control will convert a document from the format specified by InputFormat to the format specified by OutputFormat. 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 LoadSchema 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 AddRenamingRule.

After calling Translate the resulting output will contain the EDI, XML or JSON data as defined by OutputFormat. If the output data is XML the ExportXMLSchema 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 control 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:
  • OutputFile
  • OutputData: The output data is written to this property if no other destination is specified.

Property List


The following is the full list of the properties of the control with short descriptions. Click on the links for further details.

InputDataThe data to translate.
InputFileThe file to translate.
InputFormatThe format of the input data.
OutputDataThe translated data.
OutputFileThe file to which the translated data will be written.
OutputFormatThe format of the output data.
OverwriteWhether to overwrite the file.
RenamingRuleThe rule defining how EDI elements are renamed when translating to XML or JSON.
RenamingRuleCountThe number of renaming rules.
RenamingRuleIndexThe index of the current renaming rule.
SchemaFormatThe format of the schema file.
SuffixWhat to append after each segment delimiter.
UseSchemaNameWhether the output XML uses element names based on name defined in the schema.

Method List


The following is the full list of the methods of the control with short descriptions. Click on the links for further details.

AddRenamingRuleThis method adds a renaming rule to define how an EDI element is renamed when translating to XML.
ConfigSets or retrieves a configuration setting.
DisplaySchemaInfoReturns a string showing the structure of the schema defining the document.
ExportXMLSchemaExports a XML schema.
GenerateAckGenerates an EDI acknowledgement.
LoadRenamingRulesLoads a set of renaming rules from file.
LoadSchemaLoads a schema file describing a Transaction Set.
ResetResets the state of the control.
SaveRenamingRulesSaves the current renaming rule set to a file.
TranslateTranslates the specified data.

Event List


The following is the full list of the events fired by the control with short descriptions. Click on the links for further details.

EndFunctionalGroupFires whenever a control segment is read that marks the end of an interchange.
EndInterchangeFires whenever a control segment is read that marks the end of an interchange.
EndLoopFires when the end of a loop is detected in a transaction set.
EndTransactionFires whenever a control segment is read that marks the end of a transaction.
ErrorInformation about errors during data delivery.
ResolveSchemaFires whenever a new transaction set is encountered and no schema is found for it.
SegmentFires whenever a data segment in a transaction set is read.
StartFunctionalGroupFires whenever a control segment is read that marks the start of a functional group.
StartInterchangeFires whenever a control segment is read that marks the start of an interchange.
StartLoopFires when the starting of a loop is detected in a transaction set.
StartTransactionFires whenever a control segment is read that marks the start of a transaction.
WarningFires whenever a validation warning is encountered.

Configuration Settings


The following is a list of configuration settings for the control with short descriptions. Click on the links for further details.

ComponentDelimiterThe delimiter character to use to separate controls.
CrossFieldValidationEnabledEnables cross-field validation rules.
ElementDelimiterThe delimiter character to use to separate data elements.
EncodingThe character encoding to be applied when reading and writing data.
IncludeEmptyElementsWhether to include empty data elements in a composite element.
IncludeFootersWhether to include footer information in the XML.
JSONElementPrefixAn optional prefix for reserved names when translating to JSON.
LastIXControlNumberThe control number of the most recently parsed interchange.
LastTransactionControlNumberThe control number of the most recently parsed transaction.
ReleaseCharThe character to use to escape delimiters within values.
RenamingRulesDataThe renaming rules data.
RepetitionCharThe repetition character.
SegmentDelimiterThe delimiter character to use to separate segments.
StrictSchemaValidationSpecifies the behavior during schema validation.
UseXMLCommentsWhether the human readable description is stored as an attribute or XML comments.
CodePageThe system code page used for Unicode to Multibyte translations.
UseInternalSecurityAPITells the control whether or not to use the system security libraries or an internal implementation.

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