Description

The XMLFileReceiver receives data from a given GenRocket Domain and writes the data out to a file in XML format. 


Note: This particular XML Receiver does not allow for nested elements. To generate nested XML, add the SegmentDataCreatorReceiver to each Domain and then add the XMLSegmentMergeReceiver to a Merge Domain.


In This Article


Receiver Parameters

The following parameters can be defined for the XMLFileReceiver. Items with an asterisk (*) are required: 

  • path* - Defines the location to store the newly generated XML output file.
  • subDir - Defines the sub-directory within the path to store the newly generated XML output file.
  • fileName* - Defines the name of the output file.
  • appendToFile* - Determines whether the file will open in append mode. If true, XML elements will be appended to the file; otherwise, the file will be overridden.
  • uniqueAttribute - Defines a Domain Attribute the Receiver will use to identify a unique value that has already been inserted into the file and prevents it from being inserted twice.
  • rootElementName* - Defines the root element the contains the row subelements.
  • rowElementName* - Defines the name of the subelement.
  • exportStyle* - Determines how the XML is formatted.
  • booleanValue* - Format a Boolean object in the selected mask.
  • rowDelimiter* - Defines the bytes that delimit each row.
  • nullValue* - Represents a NULL value.
  • quoteTextData* - Defines the character to use when quoting text data.
     


Receiver Attribute Property Keys

The Receiver defines two property keys that can be modified on any of its associated Domain Attributes:

  • name - Defines the name of the Element or Attribute that will be written in the XML output, depending on the exportStyle chosen.

  • include - Determines if the Attribute will be included in the XML.


File Config Tab

The File Config Tab is used to configure what event will trigger file creation and the naming configuration for generated files. Please click here if you would like more information on how to use the File Config Tab.


The example below will create a new file for every 100 records. The naming for each file will look like Output-1.xml, Output-2.xml, Output-3.xml, and so on.



Directory Config Tab

The Directory Config Tab is used to configure what event will trigger directory creation and the naming configuration for generated directories. Please click here if you would like more information on how to use the Directory Config Tab.


In the example below, a subdirectory will be created for every 10 files. Each subdirectory's naming will look like AddressFiles1, AddressFiles2, AddressFiles3, and so on.


Export Style

The XML output can be presented in three different styles or formats:

  • ATTRIBUTES_ONLY
  • ELEMENTS_ONLY
  • ELEMENT_VALUE



ATTRIBUTES_ONLY

The following snippet is an example output in ATTRIBUTE_ONLY format.


<rows>
  <row id="1" firstName="Winnifred" lastName="Mooney" middleInitial="W" emailAddress="user@email.com"/>
  <row id="2" firstName="Roxie" lastName="Banner" middleInitial="M" emailAddress="user@email.com"/>
  <row id="3" firstName="Annabell" lastName="Konrad" middleInitial="V" emailAddress="user@email.com"/>
</rows>


ELEMENTS_ONLY

The following snippet is an example output in ELEMENTS_ONLY format.


<rows>
  <row>
    <id>"1"</id>
    <firstName>"Nikki"</firstName>
    <lastName>"Lovelace"</lastName>
    <middleInitial>"T"</middleInitial>
    <emailAddress>"user@email.com"</emailAddress>
  </row>
  <row>
    <id>"2"</id>
    <firstName>"Clementine"</firstName>
    <lastName>"Hollinger"</lastName>
    <middleInitial>"S"</middleInitial>
    <emailAddress>"user@email.com"</emailAddress>
  </row>
  <row>
    <id>"3"</id>
    <firstName>"Adele"</firstName>
    <lastName>"Portillo"</lastName>
    <middleInitial>"A"</middleInitial>
    <emailAddress>"user@email.com"</emailAddress>
  </row>
</rows>


ELEMENT_VALUE

The following snippet is an example output in ELEMENTS_ONLY format.


<rows>
  <row>
    <id value="1"/>
    <firstName value="Catrina"/>
    <lastName value="Deleo"/>
    <middleInitial value="L"/>
    <emailAddress value="user@email.com"/>
  </row>
  <row>
    <id value="2"/>
    <firstName value="Julie"/>
    <lastName value="Stenger"/>
    <middleInitial value="R"/>
    <emailAddress value="user@email.com"/>
  </row>
  <row>
    <id value="3"/>
    <firstName value="Mei"/>
    <lastName value="Shabazz"/>
    <middleInitial value="N"/>
    <emailAddress value="user@email.com"/>
  </row>
</rows>