Main Program

The shell main program functions are very similar to those of the other XML to legacy format utilities. We do, however, add calls (1) before processing all documents to write the X12 interchange and group header segments, and (2) after finishing to write the trailer segments.

Logic for the Shell Main Routine for XML to X12
Arguments:
  Input Directory Name
  Output X12 Interchange Name
  File Description XML Document Name

Options:
  Validate input
  Help

Validate and process command line arguments
IF help option specified
  Display help message
  Exit
ENDIF
Open output file
Create new X12TargetConverter object, passing:
    Output Stream
    File Description Document Name
Set up implementation dependent DOM environment for loading,
    parsing, and validating input documents
Open input directory
Get first file from input directory
Call X12TargetConverter writeHeaders method
DO for all files in input directory
  Input Document <- Load input file, validating it if requested
  Call X12TargetConverter processDocument method, passing
      the Input Document
  Increment number of documents processed
ENDDO
Call X12TargetConverter writeTrailers method
Close output file
Display completion message with number of documents processed

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset