Transform XSLT
Allows to do an XSLT transformation. An XSLT transformation allows to switch from one XML format to another file format among XML, CSV, TXT, JSON or HTML.
For example, you need to transform an xml file to the standard xml file of Product-Live, or you need to transform the standard xml output file of Product-Live to a specific format.
Json
Example
json
{
"name": "file-transformation-xslt",
"taskReferenceName": "transform_xslt",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${previous_taskReferenceName.output.file}",
"xslt": "file://assets/transform.xslt",
"fileName": "result.xml"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
json
{
"name": "file-transformation-xslt",
"taskReferenceName": "transform_xslt",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILES",
"files": "${previous_taskReferenceName.output.files}",
"xslt": "file://assets/transform.xslt",
"fileName": "result.xml"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
json
{
"name": "file-transformation-xslt",
"taskReferenceName": "transform_xslt",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${previous_taskReferenceName.output.file}",
"xslt": "file://assets/transform.xslt",
"params": [
{
"name": "color",
"select": "red"
},
{
"name": "settings",
"select": "file://assets/settings.xml"
},
{
"name": "items",
"select": "${previous_taskReferenceName.output.file}"
},
{
"name": "language",
"select": "${workflow.input.language}"
}
],
"fileName": "result.xml"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
Property | Description |
---|---|
mode | Enum FILE | FILES . |
file | A valid input. It can reference the output of a previous task, example: ${previous_taskReferenceName.output.file} , or a static file, example: file://assets/file.xml , or a user input, example: ${workflow.input.input_key} . |
files | 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} . |
xslt | The XLST file. Usually a static file in the assets folder. |
params | optional Allows to pass parameters to your XSLT. Then parameters are accessible within the element <xsl:param name="" /> of your xslt, where the name you used is the name of the parameter. If you need to pass a static string, the string must be encapsulated in simple quotes. It can also reference the output of a previous task, example: ${previous_taskReferenceName.output.file} , or a static file, example: file://assets/file.xml , or a user input, example: ${workflow.input.input_key} . |
fileName | The output file name |
Outputs
Property | Type | Description |
---|---|---|
file | The result of the transformation if mode = FILE . | |
files | The results of the transformations if mode = FILES . | |
listing | An XML file containing the urls of the generated temporary files. | |
allFilesTransformed | YES | NO . YES : all files have been transformed. NO : at least one file has an error. |
Output listing
Example
xml
<Files>
<File>
<Url>https://app.product-live.com/files-data-factory/d05a74cf11788d8f3ae9bf0e0e028dde66g0c83005c5e0d1211b0069945c0c11</Url>
<File-Name>product-1.xml</File-Name>
</File>
<File>
<Url>https://app.product-live.com/files-data-factory/d25a74cg11788d8f3ae9bf0e0e028dde66g0c83005c5e0d1211b0069945c0c11</Url>
<File-Name>product-2.xml</File-Name>
</File>
</Files>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Limits and additional notes
- The limitation of the input file size is 500 Mb.
In addition to these limitations, the following practices are recommended:
- Optimize your xslt by applying xslt best practices, e.g. never call the same xpath twice.
- Before developing your own xslt function, check that it doesn't already exist: http://www.xsltfunctions.com/.
FAQ
What is the version of the XSLT processor?
You can use XSLT 1.0 or 2.0 or 3.0 or 3.1.