EDIReader Configuration
The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.EDIREADER Configuration Settings
CrossFieldValidationEnabled: Enables cross-field validation rules.If true, cross-field validation rules present in the document schema will be checked. The default value is false. Note, Bots Schema Files do not support syntax rules, therefore CrossFieldValidation rules will never execute for these schemas. | |||||||
Encoding: The character encoding to be applied when reading and writing data.If the data contains non-ASCII characters this setting should be specified so characters are properly preserved. This value should be set to a valid character set such as "UTF-8" or "ISO-8859-1". | |||||||
HasXPath: Determines if the specified XPath exists.This setting can be used to query if an XPath exists before setting XPath. For instance:
Console.WriteLine(edireader.Config("HasXPath=IX/FG/TX/IT1Loop1/[2]")); | |||||||
ResolveXPathOnSet: Determines whether or not the XPath is resolved when set.When true, the component will fully resolve a detailed path when XPath is specified. In this case, the XPath property will contain the XSegment s name as well as the indices when queried after being set.
If this value is set to false, the exact string will be returned when the XPath property is queried from the last time it was set. For example, the following code will print the string "/[1]/[1]/[1]/[10]"
when this value is false, and would print "/IX[1]/FG[1]/TX[1]/IT1Loop1[4]" when this value is true:
reader.XPath = "/[1]/[1]/[1]/[10]"; Console.WriteLine(reader.XPath); In another example, the following code sample will print "IX/FG/TX/IT1Loop1"
when false and would print "/IX[1]/FG[1]/TX[1]/IT1Loop1[1]" when true:
reader.XPath = "IX/FG/TX/IT1Loop1"; Console.WriteLine(reader.XPath); This is useful in cases where the full XPath including indices is needed for future processing. | |||||||
ComponentDelimiter: The delimiter separating components.After parsing an EDI document, this configuration option will return the delimiter used to separate components within data elements of the EDI document.
This configuration option may be set in the StartInterchange event to specify the delimiter to be used. | |||||||
ElementDelimiter: The delimiter character separating data elements.After parsing an EDI document, this configuration option will return the delimiter used to separate data elements within segments of the EDI document.
This configuration option may be set in the StartInterchange event to specify the delimiter to be used. | |||||||
SegmentDelimiter: The delimiter character separating segments within the EDI document.After parsing an EDI document, this configuration option will return the delimiter used to separate segments within the EDI document.
This configuration option may be set in the StartInterchange event to specify the delimiter to be used. | |||||||
ISA11IsRepetitionSeparator: Specifies whether the ISA11 value is treated as a Repetition Separator or Standard Identifier.By default this value is True and the ISA11 value is treated as a Repetition Separator in all documents with version 004040 or greater. Set this value to False to treat ISA11 as a Standard Identifier instead of a Repetition Separator. | |||||||
ReleaseChar: The character used to escape delimiters within values.After parsing an EDI document, this configuration option will return the escape character used to escape delimiters within values within the EDI document.
This configuration option may be set in the StartInterchange event to specify the escape character to be used. | |||||||
PrintSchemas: Displays the schema defining the structure of the parsed document.After calling ParseFile this setting may be queried to obtain information about the structure of the parsed document.
If the desired XPath is not known this helps determine the structure so that the correct XPath can be built.
For instance:
Console.WriteLine(edireader.Config("PrintSchemas"));Will output text like: X12_00501_276 ST[1,1] BHT[1,1] REF[0,10] NM1Loop1[0,99999] NM1[1,1] N2[0,2] N3[0,2] N4[0,1] REF_2[0,2] PER[0,1] HLLoop1[1,99999] HL[1,1] SBR[0,1] PAT[0,1] DMG[0,1] NM1Loop2[0,99999] ... | |||||||
PrintXML: Displays the structure of the parsed document.After calling ParseFile this setting may be queried to obtain information about the structure of the parsed document. The parsed data is represented as XML when queried. This shows all parsed data and may be useful for debugging purposes. | |||||||
UseSchemaId: Specifies whether to populate the Element Name with the Id or Ref value.This setting specifies whether the ElementName is populated with the Id from the schema or with the positional (ref) value like N101.
It is only applicable to RSSBus JSON schemas.
For instance:
reader.Config("UseSchemaId=true"); reader.XPath = "/IX/FG/TX/N1Loop1[1]/N1"; for (int i = 0; i < reader.XElements.Count; i++) { Console.WriteLine(reader.XElements[i].Name + ": " + reader.XElements[i].Value); }Will populate the ElementName with the Id value read from the schema. The above will output a value like: 98: ST 93: BUYSNACKS PORT 66: 9 67: 1223334445 In contrast, if UseSchemaId is False (default) the following ElementName would be used and the output would look like: N101: ST N102: BUYSNACKS PORT N103: 9 N104: 1223334445 The default value is False. This setting is only applicable when using RSSBus JSON schemas. | |||||||
StrictSchemaValidation: Specifies the behavior during schema validation.This setting specifies what happens when performing schema validation and a validation
warning occurs. By default this value is set to 1 (Warn) and the Warning event will fire, but processing
will not stop. See the WarnCode parameter list in the Warning event for details about
possible validation warnings. Possible values for this setting are:
|
Base Configuration Settings
CodePage: The system code page used for Unicode to Multibyte translations.
The default code page is the Active Code Page (0).
The following is a list of valid code page identifiers:
|