|
Home > Online Product Documentation > Table of Contents > Understanding Separator Characters Understanding Separator CharactersEDI files consist of tokens separated by special characters. Separators typically include the following: Values for some of these separators are set explicitly in the EDI data stream. For example, in X12, the component separator is the value of the ISA16 field - the "I15: Component Element Separator." In EDIFACT, separator values can be set using the contents of the UNA segment. How Stylus Studio Sets Separator CharactersWhen writing XML to EDI, Stylus Studio overwrites separator values using a set of processing instructions (PIs). As long as the character has not been emitted to the output stream, it can be changed. For example, the segment terminator can be changed using the PI only before the first segment is written.
Invalid Separator CharactersYou cannot use any of the following characters as EDI separators: Setting Processing InstructionStylus Studio uses the following naming convention and default values for XML processing instructions used to set values for separator characters:
If a PI is used to set the value for one separator (say, A) to a default value being used by another separator (B), a new value will be chosen for the B separator unless one has already been specified. SyntaxThe syntax of the PI is just "<?" followed by the name, followed by a space, and then the new special character before a closing "?>" tag. Consider a few examples:
Here is another example, showing PIs used in context. In this example, an X12 document needed to be written to meet the following requirements: the segment terminator needed to be a carriage return; the element separator needed to be an asterisk; and the component separator needed to be a greater-than symbol. The two PIs and the Component Element Separator are shown in bold for clarity:
If the segment terminator (edi_segment) is set to
Ways to Specify Control CharactersIn addition to literal characters, you can also specify control characters using a backslash syntax, as shown here.
|