Merge XML
Task in alpha phase
This Data Factory task is in phase. You can contact the Product-Live team at contact@product-live.com if you want more details and get an early access.
Allows to merge XML files into a single XML file.
Task name:
Examples
json
{
"name": "file-transformation-merge-xml",
"taskReferenceName": "merge_xml",
"description": "Merge files into a single file",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILES",
"files": "${ftp_get.output.files}"
}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
json
{
"name": "file-transformation-merge-xml",
"taskReferenceName": "merge_xml",
"description": "Merge files into a single file",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "REQUEST",
"request": "file://assets/request.xml"
}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Definition
| Property | Type | Required | Description |
|---|---|---|---|
| The name (or type) of the task | |||
| The unique name of the task in your job. It is used to reference this task in the workflow. | |||
| The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW. | |||
true: the job continues if there is an error on this task. false: the job fails. | |||
| Input parameters of the task. See below |
Inputs Parameters
| Property | Type | Required | Description |
|---|---|---|---|
FILES | REQUEST. | |||
A valid input. It can reference the output of a previous task, example: ${previous_taskReferenceName.output.files} , or a user input, example: ${workflow.input.input_key}. | |||
| A valid input. A file that defines which files must be recovered. See the definition below. |
Input request example
xml
<Merge-Xml>
<File>
<Url>https://app.product-live.com/files-data-factory/d05a74cf11788d8f3ae9bf0e0e028dde66f0c83005c5e0d1211b0069945c0c11</Url>
</File>
<File>
<Url>https://app.product-live.com/files-data-factory/fb26911d77fe9a9dc44b111eef5b5db7ca2019c8038445662f29b20c54cb6f29</Url>
</File>
</Merge-Xml>1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Input request definition
| XPath | Description | Occurs |
|---|---|---|
Merge-Xml | Root of the document | 1 |
./File | For each file. | 0..* |
./File/Url | The url of the file | 1 |
Outputs
| Property | Type | Description |
|---|---|---|
| An XML file as described below. | ||
| An XML file as described below. | ||
YES | NO. YES: all files have been merged successfully. NO: at least one file has not been merged. |
Output file example
xml
<Merge-Xml>
<File>
<File-Name>1.xml</File-Name>
<Data>
[[XML content]]
</Data>
</File>
<File>
<File-Name>2.xml</File-Name>
<Data>
[[XML content]]
</Data>
</File>
</Merge-Xml>1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Output file definition
| XPath | Description | Occurs |
|---|---|---|
Merge-Xml | Root of the document | 1 |
Merge-Xml/File | For each file. | 0..* |
Merge-Xml/File/File-Name | The original XML file name | 1 |
Merge-Xml/File/Data | The original XML file content | 1 |
Output report example
xml
<Report task="task-transformation-merge-xml">
<Input name="mode">FILES</Input>
<Log type="error" code="err:FODC0006">
<Message>First argument to parse-xml() is not a well-formed and namespace-well-formed XML document. org.xml.sax.SAXParseException; systemId: file:/tmp/qDtxjsb5S5gKl5BW/xslt.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.Content is not allowed in prolog.</Message>
</Log>
<Log type="info" code="ADDED_FILE">
<Message>The file has been properly merged</Message>
</Log>
</Report>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Output report definition
| XPath | Description | Occurs |
|---|---|---|
Report | Root of the document | 1 |
Report/@task | The name of the task | 1 |
Report/Input | Inputs used in the task | 1..2 |
Report/Input/@name | mode | request | 1 |
Report/Log | For each log | 1..* |
Report/Log/@type | error | warning |info | 1 |
Report/Log/@code | The error | warning |info code | 1 |
Report/Log/Message | The error | warning |info message | 1 |
Output report available logs
- For following logs, whatever the severity
info,warningouerror, the task finale status is success. The task ends up in error only when an unknown error is encountered (ie. an error not listed below).
| Code | Message | Metadata | Type | Remarks |
|---|---|---|---|---|
ADDED_FILE | The file has been properly merged | - | info | This log is added for every file that has been merged and integrated to the result file. |
err:XXXXXXXX | Depends on the error | - | error | W3C standard error code. |
Limits and additional notes
- The maximum files to be merged is limited to
200. If more files are provided, the task ends with an error.