{{ transformations:ExportXmlAction.png}}
======EXPORT TO XML======
Category: Export / File\\
 
\\ 
=====Description=====
Exports the current tabular dataset into an XML file.\\
 
\\ 
=====Action settings=====
^ Setting  ^ Description  ^
|File<sup>*</sup>| The fully-qualified file name of the output dataset (includes relative or absolute path). |
|File layout|Select whether the output XML structure will be row-based or column-based.  Options:  //Row-based//\\ or //Column-based//.|
|Prohibited XML characters|Select how EasyMorph will respond when a prohibited XML character is encountered.  Options:  //Fail//,\\ //Remove the character//, or //Ignore//.|
|Indent elements|When this option is checked, the resulting XML file is formatted with indentations for better readability.|
|Omit XML declaration|When this option is checked, the instruction that identifies the file as XML is not included in the output.|
|File already exists|If a file with the same name already exists, choose whether to overwrite the existing file, rename\\ the existing file, or halt the action's execution.  See the following table for details.|
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\
\\ 
====File already exists options====
^Option ^Description ^
|Overwrite|The new file replaces the original file.|
|Rename|The original file will be renamed with "backup" and a serial number appended to the file name.  The new file will\\ possess the name specified in the //File// setting.|
|Halt project execution|The project will stop processing and this action will display a warning symbol.|

\\ 
===== File layout =====
Two types of XML layout are supported: row-based and column-based.\\

In the row-based layout, the resulting XML file is structured as a collection of row elements. For instance:

  <Columns>
    <Column Id="0" Name="state_long" />
    <Column Id="1" Name="No of companies" />
  </Columns>
  <Rows>
    <Row Id="0">
      <Cell ColumnId="0" Type="Text">California</Cell>
      <Cell ColumnId="1" Type="Number">311</Cell>
    </Row>
    <Row Id="1">
      <Cell ColumnId="0" Type="Text">Texas</Cell>
      <Cell ColumnId="1" Type="Number">220</Cell>
    </Row>
  </Rows>
\\ 
In the column-based layout, the resulting XML file is a collection of column elements. For instance:

  <Columns>
    <Column Id="0" Name="state_long">
      <Cells>
        <Cell RowId="0" Type="Text">California</Cell>
        <Cell RowId="1" Type="Text">Texas</Cell>
      </Cells>
    </Column>
    <Column Id="1" Name="No of companies">
      <Cells>
        <Cell RowId="0" Type="Number">311</Cell>
        <Cell RowId="1" Type="Number">220</Cell>
      </Cells>
    </Column>
  </Columns>

\\ 
=====Remarks=====
This action doesn't provide a means for generating additional XML attributes, or other XML elements, in addition to the predefined ones. If a specific XML structure is required, use the [[transformations:xslt|XSLT action]] to modify the output of the //Export to XML// action using XSLT stylesheets.

\\ 
=====Community examples=====
  * [[https://community.easymorph.com/t//1755/9|EasyMorph 4.3 : Tableau Hyper Addon logs]] ([[https://community.easymorph.com/uploads/short-url/22W0a67rOyb81dAD8zNmISfuMDK.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Create metadata file//; Action position: //5//)
 
\\ 
=====See also=====
  * [[transformations:exportplaintext|Export plain text]]
  * [[transformations:importxml|Import from XML]]
  * [[transformations:xslt|XSLT transformation]]