IPWorks EDI 2020 Python Edition

Questions / Feedback?

repeat_element Method

Adds a new repetition to the current element.

Syntax

def repeat_element() -> None: ...

Remarks

on_repeat_element is used to write repeated data elements in supporting version of X12 or EDIFACT. To use it, first write the first repetition of the simple or composite data element and then call on_repeat_element to repeat it, then write again.

Example: Repeating a simple data element:

  EDIWriter writer = new EDIWriter();
  ...
  writer.StartSegment("Tag");
  ...
  writer.WriteElementString("R1_1");
  writer.RepeatElement();
  writer.WriteElementString("R1_2");
  writer.RepeatElement();
  writer.WriteElementString("R1_3");
  ...
  writer.EndSegment();

Example: Repeating a composite data element:

  EDIWriter writer = new EDIWriter();
  ...
  writer.StartSegment("Tag");
  ...
  writer.StartElement();
  writer.WriteComponentString("C1_1");
  writer.WriteComponentString("C2_1");
  writer.RepeatElement();
  writer.WriteComponentString("C1_2");
  writer.WriteComponentString("C2_2");
  writer.RepeatElement();
  writer.WriteComponentString("C1_3");
  writer.EndElement();
  ...
  writer.EndSegment();

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