Creating a simple XML data format
To create a new data format for simple XML data:
- Open Format Designer.
- Click Create new data format.
-
Complete this general information:
- Format Type
- Select Simple XML.
- Name
- Specify a unique name for the new data format.
- Description
- Optionally, specify a description for the new data format.
- Click the TML Details tab.
-
Click Add
Subelement. The Add Subelement dialog
opens.
You can create an element without specifying a namespace and attribute.
-
Create the root element:
- Create a namespace. In the Namespaces section, specify the prefix and URL.
-
Click Add.
You can add multiple namespaces but you must also reselect the Namespace in the Element section.
-
Select the namespace in the Element section.
If you use a namespace, it must be allocated to an element.
- Specify a name for the root element.
-
Select the number of times the root element may occur. Select
from:
- 0...1 (minimum value=0, maximum value=1)
- 1
- 0...* (minimum value=0)
- 1...* (minimum value=1)
-
Create an attribute:
- In the Attributes section, select a namespace.
- Specify a name for the new attribute.
- Click Add.
- Optionally, add multiple attributes.
- Click OK to save your changes.
- Select an existing subelement and click Edit to update it.
- Select an existing subelement and click Delete to delete it.
- Click the up and down arrows to change field positions. Or, you can click and drag a field to the desired position.
-
Optionally, click the Script tab to
create or edit a format in text view.
Define the file schema using JavaScript. You must specify a name and optional description for each data element.Note: The data elements must be defined in the same order as that used in Transformation Designer.
-
Optionally, click Import XSD to
import an XSD file from other sources. Browse to the location of your file. The
element, namespace and attributes are extracted and inserted into the rows,
replacing any rows you have already defined.
Note: All imported files must be UTF-8 format.Note: Only simple XSD is accepted. Other complex data types are ignored. You are alerted if errors are found during the transformation of the external XSD into a simple XML schema.
- Click Save Format.