Composing the Composite Name String
The function fn_string_from_composite_name() returns the string representation of an XFN composite name given its structural form (FN_composite_name_t). The following are the rules used by fn_string_from_composite_name().
The components are added to the composite name string in left to right order (that is, rightmost is the tail).
Successive components are separated by the component separator (<ComponentSep>).
Empty components are handled in the following way:
A leading empty component is represented by a leading <ComponentSep>.
A trailing empty component is represented by a trailing <ComponentSep>.
An empty component occurring within a composite name is represented by two consecutive <ComponentSep>s.
A composite name denoting a single non-empty component does not contain any unescaped component separator.
Any occurrence of <ComponentSep> in a component is escaped by inserting <EscapeChar> immediately preceding <ComponentSep>.
If the first character of a component is either <Quote1> or <Quote2>, it will be escaped by inserting <EscapeChar> immediately preceding the quote.
Any occurrence of <EscapeChar> before <ComponentSep> in a component is escaped by inserting <EscapeChar> immediately preceding the <EscapeChar>.
Any occurrence of <EscapeChar> as the first character of a component with <Quote1> or <Quote2> as the second character in a component is escaped by inserting <EscapeChar> immediately preceding the <EscapeChar>. Subsequent <EscapeChar> occurring before any matching quote character is also escaped by inserting <EscapeChar> immediately preceding the <EscapeChar>.