XML Data object corresponds to structure of XML files. The XML data object can be associated with file server data points, like, file data point, rest data point, GCS data point, AmazonS3 data point, Hadoop DFS data point, JMS data point or Kafka data point. For more details, refer Working with Data Point.
To work with XML Data Object, follow below steps:
Step I: Edit, create or import a XML data object
- To open and edit an existing data Object, refer to the page Opening Data Object.
- To create a new data object, refer to the page Creating New Data Object.
- To import XSD schema file as data object, refer to the page Importing Data Object.
- To create XML data object based on data object of another type, refer to the page Creating copy of Data Object as other type.
It is recommended to create data object by importing the structure from the data file or schema file. Here, the XML schema file(.xsd) is required while importing which is used in creating XML Data Object.
Step II: Configuring attributes
The XML Data Object contains following fields. These fields can be edited by clicking on the field and inputting the required value.
- Level: Level number is used to specify the level of data in a record. Level numbers describe the hierarchy of the data items/ variables declared. They are used to differentiate between elementary items and group items. The level numbers include levels from 01 to 49 and special purpose levels 66, 77 and 88.
- Attribute: Displays the name of the field at a certain position in the file. This is a text field and name can be defined as needed. For XML data object the name of the field is immaterial. These field names will be used when this data object is used to create data objects of other types.
- Type: Specifies the hierarchy of XML data.
- Data Type: Displays the datatype associated with the field. This is a list of applicable data types. You can select appropriate type for the field.
- Precision: Displays the precision for the varchar, number and decimal data type. This is a text field and name can be defined as per the data in the file.
- Scale: Displays the scale for the number and decimal data type. This is a text field and name can be defined as per the data in the file.
- Min Occurs: Element name is optional and may appear at most once.
- Max Occurs: Element name is required and may repeat an unlimited number of times and when the Max value is set to -1 its referred as Unbounded.
- Reference Key: Reference key is used to pass the parent fields to child definition without the need for joining when files are normalised. Only for unbounded occurrences, the reference key field displays a drop down list with parent attributes as reference keys.
- Description: Displays any details provided for the field. This is a text field and you can enter any detail as needed.
- From the list of attributes, multiple attributes can be selected and we can perform/apply these operations.
- To add a new attribute, click Add. By default a new attribute is populated in the last row. If you want to add an attribute at a specific position then, select the attribute in the position prior to it and click Add.
- Upon selecting the reference key check boxes, when you drag a source data object to data flow canvas, the child source object displays the selected reference key fields after the last attribute in Source Attributes tab.
- For unbounded occurrence, if the reference key is not selected/defined, then by default it picks NA and displays the previous functionality.
Step III: Configuring properties
The properties tab displays the object level details relevant to extract the data from file.
The grid displays following fields,
|Property||Description||Default Value||Other possible values|
|File Name||The name of the schema is assigned as File name along with .XML extension and its editable at runtime||CustomerOrders.xml|
|Name Space||Describes the name of the namespace in which the object resides||xmlns:xs="htttp://www.w3org/2001/XMLS|
|Root Element||Specifies the root element||Root|
Note: To view specific property details, enter the keyword in the search bar, and the page displays the related properties.
Step IV: Save the changes
To save the changes made to the data object, refer Saving Data Object.
- If the changes made to the data object need to be reverted and not saved then, refer Reverting changes in Data Object.
- Once the data object has been created and the changes have been saved then, Close or Unlock the data object so that it is editable by other users. For more information, refer Closing Data Object and Unlocking Data Object.