XML Transform

This action transforms an XML document into another document using the provided transformation rules. The rules must be provided by a .XSLT definition in a file, or by another variable source.
The action allows you to convert complex XML documents into XML documents with a more manageable structure. XSLT stands for XSL Transformations. XSL stands for Extensible Stylesheet Language, and works as a stylesheet language for XML documents.
XML Transform action stores the converted XML document in the selected variable. The original file is left intact on the disk. If you want to save the converted XML document, use action Save Data to File .
Note
Typically, you would use the action to simplify XML documents provided by the host application. Defining XML filter for the complex XML document might take a while, or in some cases the XML is just too complex to be handled. As alternative, you would define the rules to convert XML into structure that can be easily handled by the XML filter, or even skipping the need for a filter altogether. You can convert XML document into natively-supported XML, such as Oracle XML and then simply executing it using the Run Oracle XML Command File action.
About group identifies the selected action.
- Name: allows you to define a custom action name. This makes actions easily recognizable on the solution's list of actions. By default, the action name is taken from its type.
- Description: custom information about the action. Enter a description to explain the purpose and role of action in a solution.
- Action type: read-only information about the selected action type.
Data Source group defines the XML data to be transformed.
-
Use data received by the trigger: defines that the trigger-received data it used. The same result can be achieved by enabling the internal variable DataFileName and using the contents of file it refers to. For more information, see section Using Compound Values in Loftware Automation user guide.
-
File name: defines the path and file name of the file containing the XML file to be transformed. Contents of the specified file is used. Data source enables the file name to be defined dynamically. Select or create a variable that contains the path and/or file name. The action opens the specified file and applies transformation on file contents, which must be XML- formatted.
-
Variable: selects or creates the variable that contains printer stream. The contents of selected variable is used and it must contain XML structure.
Transformation Rules Data Source (XSLT) group defines the transformation rules (.XSLT document) that are going to be applied to the XML document.
-
File name: defines path and file name of the file containing the transformation rules (.XSLT).
-
Custom: defines custom contents. You can use fixed content, mix of fixed and variable content, or variable content alone. To insert a variable content, click the button with arrow to the right of data area and insert variable from the list. For more information, see section Using Compound Values in Loftware Automation user guide.
Save Result to Variable group defines the variable to store the transformed file.
-
Variable: selects or creates a variable that is going to contain the result of the transformation process. E.g. if you use the rules that convert complex XML into simpler XML, the content of the selected variable is a simple XML file.
Action Execution and Error Handling
Each action can be set as a conditional action. Conditional actions only run when the defined conditions allow them to be run. To define these conditions, click Show execution and error handling options.
Execution options are:
- Enabled: specifies if the action is enabled or disabled. Only enabled actions will execute. This functionality may be used while testing a form.
- Condition: defines one-line programming expression that must provide a Boolean value (true or false). When the result of the expression is true, the action will execute. Condition offers a way to avoid executing actions every time.
Error handling options are:
- Ignore failure: specifies whether an error should be ignored. If enabled, the execution of actions continues even if the current action fails.
Note
Nested actions that depend on the current action do not execute in case of a failure. The execution of actions continues with the next action on the same level as the current action. The error is logged but does not break the execution of the action.
- Save error to variable: allows you to select or create a variable to save the error to. The same cause of the error is also saved to internal variables ActionLastErrorId and ActionLastErrorDesc.
At the end of printing, you might want to send the status update to an external application using the HTTP Request action. If the printing action fails, action processing stops. In order to execute the reporting even after the failed print action, the Print Label action must have the option Ignore failure enabled.