parse xml

This block is part of the object group and was last modified in core v12.0.4.

parse xml v12.0.4

Parses an XML string into an object with XML attributed data

In pins 5
  • XML required
    value
  • normalize
    condition

    Transforms the keys to lowercase

    Default false

  • strip prefix
    condition

    Strips the xml namespace prefix from the keys

    Default false

  • parse numbers
    condition

    Parses integer-like strings and float-like strings as floats

    Default false

  • parse booleans
    condition

    Parses boolean-like strings to booleans

    Default false

Out pins 3
  • object
    object
  • success
    condition
  • error
    value

Parses XML into an xml2js-shaped object: child elements are wrapped in ARRAYS, attributes sit under '$', mixed text under '_', and text-only elements collapse to plain strings. Example: <a b="1"><c>x</c></a> -> {a:{$:{b:"1"},c:["x"]}}. On parse failure or empty input: success=false, error carries the message, object={}.

A typical wiring for parse xml: value feeds the xml pin; the object out pin feeds custom field.

Studio canvas example for the parse xml block: typical wiring for parse xml.

Version history

Introduced in v12.0.4.


Back to object Return to the main group to view all sub-groups Back to Object Return to the group to view all blocks within this group