|
Home > Online Product Documentation > Table of Contents > The Convert to XML Editor The Convert to XML Editor
You use the Convert to XML Editor, shown here, to build a converter. The Convert to XML Editor appears when you create a new converter, or open an existing one (a
The input file is displayed in a document grid; properties that both describe the existing file (encoding and size, for example) and define the XML output that will be generated when converting this file (root and field element names, and whether or not you want the XML to be indented, for example) are displayed in the Properties window. The schema pane shows a representation of the XML Schema that will be output for the converted file. This section describes the main features of the Convert to XML Editor, including how it interacts with the adapter engine. This section covers the following topics: Document GridThe document grid displays the input file's layout, including spaces, field separators, and control characters. The input file's appearance in the document grid 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
Figure 151 shows how this character-separated input file appears in the Convert to XML Editor's document grid. 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 (
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 CharactersStylus Studio displays delimiting and control characters in a way that distinguishes them from plain text values.
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:
For example, you could enter
You can hide control characters by clicking the
Toggle Control Characters button (
Field NamesUser-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 If the field names are taken from a row within the file itself, Stylus Studio displays a blue arrow in the document grid margin to indicate this.
See Naming Fields to learn more about naming fields for XML output by Convert to XML converters. Document Grid Display FeaturesIn addition to aligning fields in character-delimited files, the Convert to XML Editor's document grid has several other features that aid readability. RulerYou can display a ruler that identifies each column:
To display the ruler, click the
Toggle Ruler button (
Displaying Pattern MatchesYou 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 (
Matching rows are displayed in a light yellow, with a green check in the grid's margin. A red X identifies rows that do not match the 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 LinesThe document grid displays both vertical and horizontal grid lines by default; you can hide/show them independently. In the example shown in Figure 158, horizontal grid lines are hidden from the display:
To hide horizontal and vertical grid lines, click the
Toggle Horizontal Grid Lines (
FontsBy 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 GridYou can move the cursor around the grid
Using Go ToYou use the Go To dialog box to jump to a specific location in the file you are using to create your converter. You can use it to move the cursor to a specific When you first display the Go To dialog box, values in the Go To fields reflect the cursor's current location within the file. The values in the Maximum fields display the maximum values for each category (file size, number of regions, and so on) for the portion of the file read into the Convert to XML Editor by Stylus Studio. To display the Go To dialog box, select Edit > Go To from the menu.
Properties WindowThe Properties window, like the one shown in Figure 160, displays information about the input file, as well as settings that Stylus Studio will use convert files to XML.
Information in the Properties window includes
How Properties are OrganizedProperties displayed in the Properties window are organized in the following categories:
Properties for Fixed-Width and Line-Oriented Input FilesFixed-width and line-oriented input files have different properties - line-oriented properties include the line terminator and field separator characters, and fixed-width files have a row length, for example. See Properties Reference to learn more about individual properties. Schema PaneThe schema pane displays a representation of the XML Schema for the XML document that will be output when the input file is converted to XML.
You can double-click on a row element to display the Set Row Name and Match Pattern dialog box, shown in Figure 162. This functionality provides an alternative to editing the row name and specifying a match pattern in the Properties window.
See Rows to learn more about specifying conversion properties for rows. |

Cart


