XML Datasource
A XML datasource is a datasource that allows data to be accessed directly from an XML file.
To use the DataSource Wizard, right-click on the folder where the XML datasource is to be created. The list of available actions will appear. Select the “Add” option, then the “Datasource” from the sub-options that appear.
The DataSource Wizard will appear. For XML datasource, there are four steps:
- Select datasource type
- Define datasource details
- Define schema
- Define security option
Select Datasource Type
In the first DataSource Wizard page, select “XML” from the list of available options, then click on the “Next” button.
Define Datasource Details
In this second page, the details of the XML datasource need to be defined.
Field | Description | Mandatory |
---|---|---|
Name | Name of XML datasource. | Yes |
Description | Brief description of XML datasource. | No |
URL | Defines the location of the XML file. | Yes |
Browse | When clicked, allows user to browse to the location of the Excel file. | No |
Data | TODO | No |
Input Format | Selects the input format. Available options: - XML (default) - Large XML (Subtree Optimisation) - HTML Parsed into XML - EDIFAST Parsed into XML |
Yes |
Date Format | Defines the format of date data type. Default is “yyy-MM-dd”. |
No |
Time Format | Defines the format of time data type. Default is “HH:mm:ss”. |
No |
Timestamp Format | Defines the format of timestamp data type. Default is “yyyy-MM-dd HH:mm:ss”. |
No |
The mandatory fields must be filled, else an error message will appear in the page with a red dot and the “Next” button will not be enabled.
Fill in the fields as required and click on the “Next” button.
Define Schema
In the next page, the schema of the XML datasource need to be defined.
There are two ways to define the schema:
- Define the Root XPath, then click on the “XPath Builder” button to load the schema
- Define the fields for the schema one by one using the buttons on the left
To add a field, click on the “Add” button at the left of the page. The “Add Column” dialog box will appear.
Key in the name of the field in the “Name” field and select the data type from the drop-down list in the “Data Type” field. In the “XPath” field, key in the XPath name and select the merge character in the “Merge” field. Click on the “Ok” button to add the column.
Repeat the same process until all desired fields as added.
The order of the fields are according to the sequence they are added. To re-order the fields, select the desired field, then click on the “Move Up” or
“Move Down” buttons to move the field to the desired position.
You can also edit the field by selecting the desired field, then clicking on the “Edit” button. The “Edit Column” dialog box will appear.
Edit the information as required and click on the “Ok” button to save the change.
If a field is added by mistake, you can remove the field by selecting it, then click on the “Delete” button.
After all required fields are added, click on the “Next” button to continue. Alternatively, if you wish to use the default security options, click on the “Finish” button to complete the process.
Security Option
The last page in the wizard for the XML datasource allows you to set the security options for the datasource.
There are three options.
Type | Description |
---|---|
Read Only | When selected and saved, the next time a user opens this datasource, the user will not be able to edit any details of the datasource (such as name, description and column names). |
Hide Details | When selected and saved, the next time when this datasource is opened, the user will only be able to see the name and description of the datasource. |
Encrypted | This is to be used with either Read Only or Hide Details options or both. Checking the checkbox will prompt the user to enter a password, then re-enter to confirm the password (both password must be the same). After this is done, if another user would like to edit any selections, he will need to enter the password. |
By default, none of the options are selected. Select the options are desired. More than one option can be selected. If “Encrypted” is selected, provide a password in the pop-up dialog box. Click on the “Finish” button to complete the process.
The new datasource will appear in the repository on the left.
You can change the security option of the datasource through the DataSource Wizard by clicking on the “Properties” icon at the Top Row in the Workspace after the datasource is selected. The third page in the DataSource Wizard allows you to change the security options.