-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Aleksandar Aytov <[email protected]>
- Loading branch information
1 parent
ac9f319
commit bc2119c
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Pretty Print XML | ||
|
||
Table of Contents | ||
|
||
* [Description](#description) | ||
* [Requirements](#requirements) | ||
* [How to use](#how-to-use) | ||
* [Expected result](#expected-result) | ||
|
||
## Description | ||
|
||
The command uses a python script to pretty print xml. | ||
|
||
## Requirements | ||
|
||
There are no requirements to use this command. | ||
|
||
## How to use | ||
|
||
1. Trigger the PrettyPrintXml command | ||
2. Enter the XML you want to pretty print in the required input key `xml` | ||
|
||
## Expected result | ||
|
||
The expected result is to receive the pretty printed XML in the `xml` output key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"id": "examples-<<<TENANT_ID>>>", | ||
"technicalName": "examples", | ||
"name": "Automation Pilot Examples", | ||
"description": "Source: https://github.com/SAP-samples/automation-pilot-examples", | ||
"owner": "<<<TENANT_ID>>>", | ||
"inputs": [], | ||
"commands": [ | ||
{ | ||
"configuration": { | ||
"values": [], | ||
"output": { | ||
"xml": "$(.prettyPrintXml.output.output | filter(length != 0 and . != \"\\t\" and . != \"\\t\\t\") | join(\"\\n\"))" | ||
}, | ||
"executors": [ | ||
{ | ||
"execute": "scripts-sapcp:ExecuteScript:2", | ||
"input": { | ||
"environment": "{\"XML\":\"$(.execution.input.xml | toEscapedJson)\"}", | ||
"script": "printf \"%s\" \"${XML}\" > data.xml\n\necho 'import xml.dom.minidom\n\ndom = xml.dom.minidom.parse(\"data.xml\")\npretty_xml_as_string = dom.toprettyxml()\nprint(pretty_xml_as_string)\n' > program.py\n\npython3 program.py" | ||
}, | ||
"alias": "prettyPrintXml", | ||
"description": null, | ||
"progressMessage": null, | ||
"initialDelay": null, | ||
"pause": null, | ||
"when": null, | ||
"validate": null, | ||
"autoRetry": null, | ||
"repeat": null, | ||
"errorMessages": [], | ||
"dryRun": null | ||
} | ||
], | ||
"listeners": [] | ||
}, | ||
"id": "examples-<<<TENANT_ID>>>:PrettyPrintXml:1", | ||
"name": "PrettyPrintXml", | ||
"description": null, | ||
"catalog": "examples-<<<TENANT_ID>>>", | ||
"version": 1, | ||
"inputKeys": { | ||
"xml": { | ||
"type": "string", | ||
"sensitive": false, | ||
"required": true, | ||
"minSize": null, | ||
"maxSize": null, | ||
"minValue": null, | ||
"maxValue": null, | ||
"allowedValues": null, | ||
"allowedValuesFromInputKeys": null, | ||
"suggestedValues": null, | ||
"suggestedValuesFromInputKeys": null, | ||
"defaultValue": null, | ||
"defaultValueFromInput": null, | ||
"description": null | ||
} | ||
}, | ||
"outputKeys": { | ||
"xml": { | ||
"type": "string", | ||
"sensitive": false, | ||
"description": null | ||
} | ||
}, | ||
"tags": {} | ||
} | ||
] | ||
} |