2

Hi am using an xslt transformer and using an xsl file am using a function ex:date-time() its running in Anypoint studio but when I try to run in cloudHub its throwing an error
Cannot find a matching 0-argument function named {http://exslt.org/dates-and-times}date-time(). There is no Saxon extension function with the local name date-time (net.sf.saxon.trans.XPathException)

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
 exclude-result-prefixes="xs ">
 <xsl:output method="xml" encoding="UTF-8" indent="yes" />
 <xsl:template match="/">
  <xsl:variable name="var1" select="." />
  <_ord:testOrder 
   xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex"
  
   <xsl:attribute name="xsi:schemaLocation"
    namespace="http://www.w3.org/2001/XMLSchema-instance">
    <xsl:value-of select="test" />
   </xsl:attribute>
   <_wcf:ApplicationArea>
   <_oa:CreationDateTime><xsl:value-of select="ex:date-time()"/></_oa:CreationDateTime>
   
   </_wcf:ApplicationArea>
   
          </_ord:testOrder>
   
   </xsl:template>
</xsl:stylesheet>
Satheesh Kumar
  • 797
  • 7
  • 31
  • Apparently Anypoint studio supports EXSLT, but Cloudhub doesn't. If you show the code, perhaps there is a workaround that does not use this function? – Mathias Müller Feb 13 '15 at 14:36
  • Hi Mathias added xslt code above – Satheesh Kumar Feb 13 '15 at 14:50
  • Is there any way i can add any EXSLT jar in cloudhub – Satheesh Kumar Feb 13 '15 at 15:00
  • 1
    The exception named `net.sf.saxon.trans.XPathException` suggests that Saxon 8 or 9 is being used. In that case consider to simply write XSLT 2.0 with its built-in support for `xs:date` and `xs:dateTime` data types and functions like http://www.w3.org/TR/xquery-operators/#func-current-dateTime instead of trying to use XSLT 1.0 with poorly support EXSLT extensions. – Martin Honnen Feb 13 '15 at 15:41
  • 1
    Consider testing your app on Mule Standalone locally on your machine: it should fail the same way as in CloudHub, thus making it easier for you to look for a workaround. – David Dossot Feb 13 '15 at 22:47

3 Answers3

1

CloudHub tends to use the lastest and greatest version of Mule. In 3.6 a huge overhaul of the XML dependencies have been done.

My guess is that you are probably testing localy against 3.5 and then running in cloudhub against 3.6. Please try setting your cloudhub configuration to use 3.5.

Víctor Romero
  • 5,107
  • 2
  • 22
  • 32
1

Need separate license to use these functions.I think you are using HE of Saxon.Get Enterprise Edition of Saxon

Daniel
  • 60
  • 6
0

when referring xsl file via xslt transformer, it takes the full path of the xsl file, so i suspect the path was not modified so while deploying the project to cloudhub it was executing.

so after referring the xsl file via xslt transformer modify the path considering resource folder as root.

Mohan
  • 520
  • 4
  • 16