Recipient List Transformation
You can transform the XML format of a USAData to conform to the schema you are using in the product’s Plan file. For example, you may want to add information to the USAData recipient list or change a column header’s name in the list to match your Plan.
The following is an example of a USAData XML:
<NewDataSet>
<RecipitentList>
<PrefixTTL />
<IndividualName>John Smith</IndividualName>
<firstname>John</firstname>
<middlename />
<lastname>Smith</lastname>
<address>279 East 44th St</address>
<Address2line></Address2line>
<city>New York</city>
<State>NY</State>
<zip>10017</zip>
<zip4>4349</zip4>
<DPBC>380</DPBC>
<PreDirectional>E</PreDirectional>
<Number>279</Number>
<street_name>44th St</street_name>
<CRRT>C045</CRRT>
<Lat>40.75131</Lat>
<long>-073.97170</long>
</RecipitentList>
<RecipitentList>
<PrefixTTL>Mrs</PrefixTTL>
<IndividualName>Mark Lord</IndividualName>
<firstname>Mark</firstname>
<middlename></middlename>
<lastname>Lord</lastname>
<address>150 East 49th St</address>
<Address2line>Apt 5B</Address2line>
<city>New York</city>
<State>NY</State>
<zip>10017</zip>
<zip4>1236</zip4>
<DPBC>522</DPBC>
<PreDirectional>E</PreDirectional>
<Number>150</Number>
<street_name>49th St</street_name>
<CRRT>C058</CRRT>
<Lat>40.75574</Lat>
<long>-073.97259</long>
</RecipitentList>
</NewDataSet>
The following is an example of the XSLT that you need to create in order to transform the USAData XML to match your Plan:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/">
<NewDataSet>
<xsl:for-each select="NewDataSet/RecipitentList">
<RecipientList>
<Category></Category>
<City><xsl:value-of select="city" /></City>
<FirstName><xsl:value-of select="FirstName" /></FirstName>
<Gender><xsl:value-of select="Gender" /></Gender>
<id><xsl:value-of select="IndividualName" /></id>
<LastName><xsl:value-of select="LastName" /></LastName>
<State><xsl:value-of select="State" /></State>
<Street><xsl:value-of select="address" /></Street>
<ZIP><xsl:value-of select="zip" /></ZIP>
</RecipientList>
</xsl:for-each>
</NewDataSet>
</xsl:template>
</xsl:stylesheet>
When using USAData in Cross-Media products, in order to be able to view proof of the web site, sample data should be entered using the recipient list transformation, for example:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/">
<NewDataSet>
<xsl:for-each select="NewDataSet/RecipitentList">
<RecipientList>
<Category></Category>
<City>
<xsl:value-of select="city" />
<xsl:if test=”not(city)”>New York</xsl:if>
</City>
<FirstName>
<xsl:value-of select="FirstName" />
<xsl:if test="not(firstname)">John</xsl:if>
</FirstName>
<Gender>
<xsl:value-of select="Gender" />
<xsl:if test=”not(Gender)”>Male</xsl:if>
</Gender>
<id>
<xsl:value-of select="IndividualName" />
<xsl:if test=”not(IndividualName)”>John.Doe</xsl:if>
</id>
<LastName>
<xsl:value-of select="LastName" />
<xsl:if test=”not(LastName)”>Doe</xsl:if>
</LastName>
<State>
<xsl:value-of select="State" />
<xsl:if test=”not(State)”>NY</xsl:if>
</State>
<Street>
<xsl:value-of select="address" />
<xsl:if test=”not(address)”>My street name</xsl:if>
</Street>
<ZIP>
<xsl:value-of select="zip" />
<xsl:if test=”not(zip)”>10000</xsl:if>
</ZIP>
</RecipientList>
</xsl:for-each>
</NewDataSet>
</xsl:template>
</xsl:stylesheet>
To transform a recipient list's XML:
-
On the toolbar click Presets, and then select System Setup.
-
In the System Setup list, click Recipient List Transformation.
A list of all recipient lists (including USAData) currently defined in the uStore system is displayed.
-
Click the Edit
button
next to the recipient list
whose XML you want to transform.The Recipient List Transformation page for the selected recipient list is displayed.
-
Fill in the following fields:
-
ID: N.A.
-
Product ID: Product ID in which the USAData recipient list is used.
-
Transformation: Enter the XSL that will be used for transforming the USAData XML. See the sample code above.
-
-
Click Save.