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.


Parameters

The XMLFileReceiver requires that the following parameters are defined:

  • path - Defines the location 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.


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.


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>