Nav

read

read(String | Binary, String, Object)

Reads the input content (string or binary) with a mimeType reader for the data format of the input and returns the result of parsing that content.

The first argument provides the content to read. The second is its format (or content type). The default content type is application/dw. A third, optional argument sets reader configuration properties.

For other formats and reader configuration properties, see Data Formats Supported by DataWeave.

Transform

        
     
1
2
3
4
%dw 2.0
output application/xml
---
 read('{"name":"DataWeave"}', "application/json")
Output

        
     
1
<name>DataWeave</name>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+