Document Pane

The document pane displays the input file's layout, including spaces, field separators, and control characters. The input file's appearance in the document pane is determined, in part, by its format.

This section covers the following topics:

Example - .txt Files

Stylus Studio uses slightly different displays for character-separated and fixed-width .txt files. Consider this file, which uses commas as the field separator:

Figure 150 shows how this character-separated input file appears in the Custom XML Conversion Editor's document pane. By default, Stylus Studio aligns columns and fills the empty cells of the shorter rows with a light blue to aid readability:

You can remove these spaces from the display and view the file in its native format by clicking the Align Fields button ( ) on the tool bar, or by selecting CustomXMLConversion > Align Fields on the menu. This results in the layout shown in Figure 151.

Fixed-width files are displayed in a slightly different fashion. Consider this fixed-width input file:

In a fixed-width file, the empty cells represent actual values (spaces) in the input file. In the second row of this input file, for example, there are three spaces between the first and second columns:

Display of Delimiting and Control Characters

Stylus Studio displays delimiting and control characters in a way that distinguishes them from plain text values.

l Delimiting characters, like the comma used in the example in Figure 150, are displayed with a dark blue background. For files that include sub-fields or arrays (like EDI, for example), the sub-field separator character is shown in a different shade of blue. Sub-sub-fields delimiting characters are shown in a shade of purple.
l Control characters (line feeds and carriage returns, for example) are shown using their abbreviated ASCII value. A carriage return (0x0D) line feed (0x0A) is shown as , for example. ASCII abbreviations are aligned vertically, to preserve space, as shown in this representation of the ASCII value for tab (0x09): .
Stylus Studio understands all Unicode characters,. When editing Line-Oriented Region and Field Name values in the Properties window, you can enter mnemonic values for the C1 and C0 control characters in the following ranges:
n C0 control characters with a value from >= 0x00 to <= 0x1F
n C1 control characters with a value from >=0x80 to <= 0x9F
l Characters that are discarded from output (like line terminators such as CR and LF and comment lines) are displayed against a gray background.

You can hide control characters by clicking the Toggle Control Characters button ( ) on the tool bar, or by selecting ConvertToXML > Toggle Control Characters from the menu.

Field Names

User-defined field names - values that Stylus Studio uses to create the element names in converted XML - are displayed in green, as shown here:

You can edit these names

l In-place, by double-clicking the field name
l In the Field Element Name field of the Properties window

If the field names are taken from a row within the file itself, Stylus Studio displays a blue arrow in the document pane margin to indicate this.

See Naming Fields to learn more about naming fields for XML output by custom XML conversion definitions.

Document Pane Display Features

In addition to aligning fields in character-delimited files, the Custom XML Conversion Editor's document pane has several other features that aid readability.

Ruler

You can display a ruler that identifies each column:

To display the ruler, click the Toggle Ruler button ( ) on the tool bar, or select CustomXMLConversion > Toggle Ruler from the menu.
Displaying Pattern Matches

You can define match patterns using regular expressions to control which rows are converted to XML and, optionally, the name to use for these rows. You can highlight rows that match the patterns that you have defined, as shown here:

To highlight matching rows, click the Highlight Matching Rows button ( ) on the tool bar, or select CustomXMLConversion > Highlight Matching Rows from the menu.

Matching rows are displayed in light yellow, with a green check in the pane's margin. A red X identifies rows that do not match the current pattern. Gray squares identify rows that match a pattern other than the pattern defined for the row that currently has focus. See Specifying Multiple Match Patterns for more information on this feature.

See Pattern Matching to learn more about using regular expressions to define match patterns.

Grid Lines

The document pane displays both vertical and horizontal lines by default; you can hide/show them independently. In the example shown in Figure 157, horizontal lines are hidden from the display:

To hide horizontal and vertical grid lines, click the Toggle Horizontal Grid Lines ( ) and/or Toggle Vertical Grid Lines ( ) buttons on the tool bar, or select ConvertToXML > Toggle Horizontal Grid Lines and/or Toggle Vertical Grid Lines from the menu.

Fonts

By default, the input document is displayed using the Courier New font in 12pt. You can change the display font to suit your personal preference using the Edit > Change Font and Edit > Font Size menus.

Moving Around the Document

You can move the cursor around the document using

l The Space bar on your keyboard
l The directional arrows and Page Up, Page Down, Home, and End keys on your keyboard
l Your mouse (click on the character on which you want to place the cursor)
l The Go To dialog box
 
Free Stylus Studio XML Training: