Skip to main content
Version: 4.14.4

Form to XML component

The Form to XML component provides a direct conversion from the Form url encoded format to XML format. This component could, for example, be used when you submit an HTML form to a Dovetail endpoint.

Configuration

At this moment there are no configuration parameters and the default text encoding is UTF-8.

Remarks

  • This component supports empty values for a given key.
  • Invalid XML characters will be filtered out of the Key names. Following rules apply:
    • Names can't begin with a digit
    • Names can't contain special characters other than the period, hyphen, underscore, and colon
    • Names can't start with special characters like hyphens or periods
    • Names can't start with any variation of 'xml'

Examples

Valid data

When given the following data input...


first-name=Joe&last-name=Foo&age=21

...The Form to XML component will yield the following output:


<?xml version="1.0" encoding="UTF-8"?>
<item>
<first-name>Joe</first-name>
<last-name>Foo</last-name>
<age>21</age>
</item>

Invalid or missing data

If the data is incomplete or invalid it will still return the best possible outcome...


first-name=John&last-name=&age=25&991=porsche

In this case the last-name will have no value and the invalid parameter named 911 will be ignored:


<?xml version="1.0" encoding="UTF-8"?>
<item>
<first-name>John</first-name>
<last-name></last-name>
<age>25</age>
</item>