7.1
2013-01-30

XML options

XSLT is a language for transforming XML documents into XML documents or even plain text. With XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange and sort elements, perform tests and make decisions about which elements to remove and keep. More information can be found at: http://www.w3schools.com/

By activating the Apply XSLT style sheet option the connector will apply the XSLT style sheet stated in the Style sheet text area to the XML output. It is applied before writing the information to disk or before sending it using a HTTP POST call. This way the XML structure can be modified to match the requirements of the receiving application.

Sample XML files may be obtainded by setting up a demo version of PrintShop Mail Web on your local machine and using the Write to file option. The resulting file than can be used in a application like XML Spy or Cooktop to develop the XSLT style sheet.

<!--This is an sample stylesheet-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
 <xsl:template match="/">
  <PrintShopCommunication>
   <Order>
    <xsl:attribute name="id"><xsl:value-of select="//fnOrderID"/></xsl:attribute>
    <xsl:attribute name="statusid"><xsl:value-of select="//fnOrderStatusID"/></xsl:attribute>
    <xsl:attribute name="status"><xsl:value-of select="//fcOrderStatus"/></xsl:attribute>
    <Information>
     <Created><xsl:value-of select="//fdCreated"/></Created>
    </Information>
   </Order>
  </PrintShopCommunication>
 </xsl:template>
</xsl:stylesheet>

The sample XSLT code creates the following XML output:

<PrintShopCommunication>
  <Order id="19" statusid="1" status="cOrder">
    <Information>
      <Created>2007-10-08 16:01:41</Created>
    </Information>
  </Order>
</PrintShopCommunication>