The following procedures are related to creating and modifying an XML schema file for transforming data between a character-delimited variable format and an XML format.
Creating a schema file
To create a new schema file:
- Launch the Text Transformation tool.
- Select File > New, or click the New icon on the toolbar.
- Select a path, and type the name of the XML schema file to create.
Note: The default file name is "Default.xml."
- Select CSV Format.
Note: Do not select WebSphere Commerce Suite Format. This option is only used with earlier versions of WebSphere Commerce.
- Click OK when you are finished.
Now you can create new elements and attributes by following the steps indicated below.
Opening a schema file
To open a schema file:
- Launch the Text Transformation tool.
- Select File > Open, or click the Open icon on the toolbar.
- Select a schema file to be opened.
- Click OK when you are finished.
Now you can modify the elements and attributes by following the steps described below.
Saving a schema file
To save a schema file:
- Launch the Text Transformation tool.
- To save any changes that you make to the schema, select File > Save or click the Save icon on the toolbar.
- To save a copy of the schema with a new name:
- Select File > Save As.
- Select a path and type the name of the XML file to create.
- Click OK when you are finished.
Editing a schema file
To edit a schema file, open the schema file as described above and follow these procedures.
Adding an element
To add an element:
- Type a new element name in the Element List field.
- Click the Add row icon.
Removing an element
To remove an element:
- Select an element name.
- Click the Remove row icon.
Replacing an element
To replace an element:
- Type a new element name in the Element List field.
- Select the name of the element to be replaced.
- Click the Replace row icon.
Moving an element one row up
To move an element one row up:
- Select the name of the element to be moved up.
- Click the Move row up icon.
Moving an element one row down
To move an element one row down:
- Select the name of the element to be moved down.
- Click the Move row down icon.
Adding an attribute
To add an attribute:
- Type a new attribute name in the Attribute List field.
- Click the Add row icon.
Removing an attribute
To remove an attribute:
- Select an attribute name.
- Click the Remove row icon.
Replacing an attribute
To replace an attribute:
- Type a new attribute name in the Attribute List field.
- Select the name of the attribute to be replaced.
- Click the Replace row icon.
Moving an attribute one row up
To move an attribute one row up:
- Select the name of the attribute to be moved up.
- Click the Move row up icon.
Moving an attribute one row down
To move an attribute one row down:
- Select the name of the attribute to be moved down.
- Click the Move row down icon.
Changing a schema file structure
The File Structure view in the lower pane of the Text Schema Edit View describes the layout of a character-delimited variable file. The following fields are required in the expected file structure:
- Field Separator
Specifies the delimiter that separates attribute values. The default is a comma (",").
- Record Separator
Specifies the delimiter that separates data records. The default is " " (This is equivalent to an entity reference to \r\n.)
- String Delimiter
Specifies the delimiter that indicates the string start and end boundary. The default is a single quote (" ' ").
- Header Included
A Boolean value, specified as "true" if there is a header line in the text data file and "false" if there is no header line in the text data file. If there is a header line, it must conform to the XML rules for a tag name because the header will be used as the XML tag name in this case. The default is "false."
- Number of header lines
Specifies the line number header lines that exist in the text data file. The default is a zero ("0").
Editing a schema file for transforming data from an XML to a character-delimited variable format
If you are using an XML schema file that was created using the Text Schema Edit View to transform data from an XML format to a character-delimited variable format, you must use a text editor to change the datatype specification in the schema file from "CSV Format" to "XML Format" before processing the transformation.