This pipeline shows how we do what you are looking for.
The XML Generator contains the following in the edit window:
With that data we map it in the mapper as follows, the output of the XML Generator is a string called xml.
We map that to the content field and also add the content-type for the Document to Binary Snap. This enables us to put the information in a native XML form, with the necessary metadata.:
Then we need to ensure no encoding takes place on the Doucment to Binary Snap, which converts the document input to a binary stream, like the output of a file reader:
After that, the XML parser can read the input stream as an XML binary document.
The output of the XML parser reads the data as follows:
Which we then need to split using the JSON splitter to process as individual documents:
And the final output of the splitter:
Let us know if this helps.