elasticio / xml-component

Component to parse, validate, generate XML data & attachments for elastic.io platform
Other
0 stars 5 forks source link

Add revised write XML action #30

Closed jhorbulyk closed 4 years ago

jhorbulyk commented 4 years ago

The existing JSON to XML action has the following shortcomings:

  1. XML component lacks any transformation capacity for the JSON to XML case. Can be overcome by adding JSONata transform in front but that is cumbersome.
  2. Lack the capacity to create attachments in the JSON to XML case. Can be overcome by adding the utility component afterwards but is also cumbersome.
  3. JSON to XML case wrap things in a tag by default. There is a setting explicitRoot in the converter library to toggle this: https://www.npmjs.com/package/xml2js#options This change can't be cleanly implemented without making backwards incompatible changes thus justifying the need for a new action.
  4. The existing library has memory problems and it may be beneficial to migrate away: https://github.com/elasticio/xml-component/issues/17