X4 Produktdokumentation

YAML Converter

This adapter converts a YAML document to an XML document and vice versa.

Properties

Operation

Describes which operation the adapter performs.

Possible values:

  • Convert YAML to XML: Converts a YAML document to an XML document

  • Convert XML to YAML: Converts a XML document to an YAML document

Parameters

processStrings

Defines whether numeric values and boolean values are read and normalized by the adapter (true) or treated as literal strings (false).

Possible values:

  • true: Numeric values and boolean values are read and normalized

  • false: Numeric values and boolean values are treated as literal strings

Status values

1

The conversion was successful and an output is generated

-1

An error occurred while the operation was running (no output is generated)

Input

Depending on the selected operation, the adapter expects a specific input structure:

  • Convert YAML to XML:

    YAML Input

    example:
        element1:
        - value1
        - value2
        - childValue1: 1
          childValue2: 2
        element2: value3
    
  • Convert XML to YAML:

    XML Input

    XML
    <Object>
        <Object name="example">
           <Array name="element1">
             <Value>value1</Value>
             <Value>value2</Value>
             <Object>
              <Value name="childValue1">1</Value>
              <Value name="childValue2">2</Value>
             </Object>
           </Array>
           <Value name="element2">value3</Value>
        </Object>
    </Object>
    

Output

Depending on the selected operation, the adapter outputs the following structure:

  • Convert YAML to XML:

    XML output

    XML
    <Object>
        <Array name="element1">
           <Value>value1</Value>
           <Value>value2</Value>
           <Object>
             <Value name="childValue1">1</Value>
             <Value name="childValue2">2</Value>
           </Object>
        </Array>
        <Value name="element2">value3</Value>
    </Object>
    
  • Convert XML to YAML:

    YAML output

    element1:
    - value1
    - value2
    - {childValue1: 1, childValue2: 2}
    element2: value3