Skip to main content


 

Symptoms

 


DataEvent - Transform data with XLS Template
 

 

Diagnoses

 


I have a SmartObject Event where xml data is copied into an xml field. That works fine. Next, a DataEvent happens where the xml field is transformed to html using an xls file. When I try to deploy, it gives me the error window with 0 errors and 0 warning.

 

 

 

Invoices.xml:
===
<XmlDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Invoices><Invoice amount="9699.92" name="602131">Invoice1</Invoice><Invoice amount="12063.02" name="600357">Invoice1</Invoice></Invoices></XmlDocument>

 


Invoices.xsl:
===
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

 

<xsl:template match="/">
<html><body>In
<xsl:if test="count(XmlDocument/Invoices/Invoice) > 0">
  <h3>Additional Invoices</h3>
    <table border="0" width="150">

 

  <tr>
        <th style="text-align:left">Invoice</th>
        <th style="text-align:right">Amount</th>
  </tr> 

 

  <xsl:for-each select="XmlDocument/Invoices/Invoice">
   <tr>
   <td><xsl:value-of select="@name"/></td>
   <td style="text-align:right"><xsl:value-of select='format-number(@amount,"#,###,###.00")'/></td>
   <tr>
  </xsl:for-each>
    </table>
</xsl:if>
</body></html>
</xsl:template>
</xsl:stylesheet>

 

 

 

Resolution

When attempting the deploy the same workflow from K2 for Visual Studio, a build error does get logged regarding the .XSL being malformed. It was determined that one of the node was not closed correctly in the .XSL after correcting the .XSL, the workflow now builds and deploys successfully. Additionally, a TFS item was logged against the K2 Studio designer to be addressed in a future update to be able to surface/throw the same error as in K2 for Visual Studio during workflow deployment.

 

 



 
Be the first to reply!

Reply