arrayToJSON

The arrayToJSON function is used to transform the content of an XML node list into a JSON array.

Syntax

c4i:arrayToJSON(xpath)

Parameters

xpath

The xpath to a XML node list

Return value

A JSON array

Example

Given the following STEP XML :

<STEP-ProductInformation>
    <Products>
        <Product ID="PRD1">
            <AssetCrossReference Type="PrimaryImage" AssetID="IMG1"/>
            <AssetCrossReference Type="PrimaryImage" AssetID="IMG2"/>
        </Product>
    </Products>
</STEP-ProductInformation>

The following YAML configuration will produce the following output :

c4i:arrayToJSON(AssetCrossReference[@Type="PrimaryImage"]/@AssetID)
["IMG1", "IMGZ"]
Last Updated: