XML utilities


This topic describes the common XML utilities available with TrueSight Orchestration Content.

Important

The XML utilities are compatible only with TrueSight Orchestration Platform 7.9 and later. On the TrueSight Orchestration peers, the json-20160316j6.jar file is located in the /tomcat/webapps/baocdp/WEB-INF/lib folder. 

Add XML

New in 20.18.01

This utility adds a child XML to a parent XML. This utility does not verify the validity or the accuracy of either of the XMLs. If there's an error in any of the XML, the process fails and goes in a compensated state. 

Workflow input elements

Input element

Description

Required

parent XML

Specifies the main XML to which you want to merge another XML.

Yes

child XML

Specifies the child XML to be merged with the parent XML.

Yes

Workflow output elements

Output element

Description

result XML

Specifies the XML output

Convert JSON to XML

This utility converts JSON to XML. To use this utility, the json.jar file must be installed on your TrueSight Orchestration peers and TrueSight Orchestration Development Studio.

Note

While running the Convert JSON to XML utility, if the conversion does not occur and the workflow returns the same JSON-formatted string, this may be due to an incorrect library function being called. For more information on resolving this issue, see the BMC Knowledge Article 000131175: Atrium Orchestrator's "Convert JSON to XML" workflow returns JSON, not XML

Workflow input elements

Input element

Description

Required

JSON

Specifies the JSON to be converted into XML

Yes

Workflow output elements

Output element

Description

XML

Specifies the XML output

Convert XML to JSON

This utility converts XML to JSON. The XML namespaces are striped to be converted to JSON.

Note

For XML with attributes, use the Convert XML Attributes to Elements workflow to convert XML attributes to elements first, and then convert to JSON.

Workflow input elements

Input element

Description

Required

XML

Specifies the XML to be converted into JSON

Yes

Workflow output elements

Output element

Description

JSON

Specifies the JSON output

Convert XML Attributes to Elements

This utility converts XML attributes to elements before converting it to JSON. 

Workflow input elements

Input element

Description

Required

XML

Specifies the XML whose attributes need to be converted into elements

Yes

Workflow output elements

Output element

Description

XMLNoAttribute

Specifies XML with no attributes

Strip Namespaces

This utility strips namespaces from the XML document. 

Workflow input elements

Input element

Description

Required

XML

Specifies the XML document from which to strip the namespaces

Yes

Workflow output elements

Output element

Description

XML

The submitted XML without namespaces

XML String to XML

This utility strips the XML headers and doctype elements from the XML strings to XML.

Workflow input elements

Input element

Description

Required

XML String

Specifies the formatted XML string

Yes

Workflow output elements

Output element

Description

XML

The submitted XML without the XML strings

Create For Loop XML

This utility creates a loop that detects the size of the input and parses it in smaller segments, appending the segments together to create a fully-parsed result.

Workflow input elements

Input element

Description

Required

loopaccount

Specifies a whole number indicating the number of elements the loop should have

For example,

Yes

root element name

Specifies the name of the root element to be used in the output XML

If not specified, a default value of 'loops' is used.

No

child element name

Specifies the name of the child element to be used in the output XML

If not specified, a default value of 'loop' is used.

No

Workflow output elements

Output element

Description

loop

Specifies an XML document in the following format:

<loops>
<loop>1</loop>
<loop>2</loop>
(any number of iterations)
</loops>

String to XML using Delimiter

This utility segments a string on a specified delimiter. 

Workflow input elements

Input element

Description

Required

string

Specifies a string that contains delimiters such as comma (,), pipe (|), and so on

For example,

Delimited using commas: a,b,c,d

Delimited using pipes: a|b|c|d

Delimited using colons: a:b:c:d

Yes

delimiter

Specifies any set of characters that can be used in a regular expression

Tokenization uses the delimiter as a regular expression. You must append a regular expression special character with a backslash.

For a list of characters that must be appended with a back slash, see Pattern (Java Platform) .

For example, pipe character (|) should be escaped by using two backslash characters like - \|

Yes

root element name

Specifies the name of the root element to be used in the output XML

If not specified, a default value of 'loops' is used.

No 

child element name

Specifies the name of the child element to be used in the output XML

If not specified, a default value of 'loop' is used.

 No

Workflow output elements

Output element

Description

XML

Contains the XML output

Back to top

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*