title: How do I enable XSLT 2.0 processor in JBoss eap 6.1 server, to get rid of errors like XSLT 2.0 functions are not available
body: <p>I am trying date formatting in XSLT 2.0. When I try to run it in my workspace it runs fine and I get a proper response. But when I try to achieve the same after deploying the my jar on JBoss eap 6.1, I get below error:</p>
  
  <p><strong>16:35:02,311 ERROR [XSLTUtil] (DefaultQuartzScheduler-camel-12_Worker-2) XSLTUtil|0|TransformerException : Error occured while transforming xml with the xslt file :
  javax.xml.transform.TransformerException: org.xml.sax.SAXException: Could not find function: format-dateTime
  javax.xml.transform.TransformerException: Could not find function: format-dateTime|</strong></p>
  
  <p>My Xsl file : here I am trying to format the the current date to some other format using format-dateTime. </p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;xsl:stylesheet version='2.0'
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' 
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:func="http://exslt.org/functions" 
      xmlns:date="http://exslt.org/dates-and-times" 
      date:doc="http://www.exslt.org/date" exclude-result-prefixes="date func"&gt;
  
      &lt;xsl:import href="date.xsl"/&gt;
      &lt;xsl:output method="xml" encoding="UTF-8" indent="yes" /&gt;
      &lt;xsl:template match="/"&gt;
          &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:max="http://www.ibm.com/maximo"&gt;
              &lt;soapenv:Header/&gt;
              &lt;soapenv:Body&gt;
                  &lt;max:CreateMXINCIDENT_WSTB creationDateTime="" baseLanguage="" transLanguage="" messageID="" maximoVersion=""&gt;
                      &lt;max:MXINCIDENT_WSTBSet&gt;
                          &lt;max:MXINCIDENT_WST action="" relationship="" deleteForInsert="" transLanguage=""&gt;
                              &lt;max:MAXINTERRORMSG&gt;&lt;/max:MAXINTERRORMSG&gt;
                              &lt;max:ACTIVITY changed="true"&gt;
                                  &lt;xsl:value-of select='/tTroubleticket/activity' /&gt;
                              &lt;/max:ACTIVITY&gt;
                              &lt;max:BLOCK changed=""&gt;
                                  &lt;xsl:value-of select='/tTroubleticket/block' /&gt;
                              &lt;/max:BLOCK&gt;
                              &lt;max:CHANGEBY changed="true"&gt;AOS&lt;/max:CHANGEBY&gt;
                              &lt;max:CHANGEDATE changed="true"&gt;
                                  &lt;xsl:value-of select="format-dateTime(current-dateTime(), '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z]')" /&gt;
                              &lt;/max:CHANGEDATE&gt;
                              &lt;max:CLASS changed="true"&gt;INCIDENT&lt;/max:CLASS&gt;
                              &lt;max:COMMERRORTYPE changed="true"&gt;
                                  &lt;xsl:value-of select='/tTroubleticket/commErrorType' /&gt;
                              &lt;/max:COMMERRORTYPE&gt;
                              &lt;max:COMPONENTLIST changed="true"&gt;&lt;/max:COMPONENTLIST&gt;
                              &lt;max:CREATEDBY changed=""&gt;&lt;/max:CREATEDBY&gt;
                              &lt;max:CREATIONDATE changed="true"&gt;
                                  &lt;xsl:value-of select="/tTroubleticket/interactiondate" /&gt;
                                  &lt;!-- &lt;xsl:variable name="date" select="/tTroubleticket/interactiondate"&gt;&lt;/xsl:variable&gt;
                                  &lt;xsl:variable name="intDt" select="xs:dateTime(concat(
                                      substring($date, 1, 4),'-',
                                      substring($date, 6, 2),'-',
                                      substring($date, 9, 2),'T',
                                      substring($date, 12, 2),':',
                                      substring($date, 15, 2),':',
                                      substring($date, 18, 2)))"&gt;&lt;/xsl:variable&gt;
                                  &lt;xsl:value-of select="format-dateTime($intDt, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z]')" /&gt; --&gt;
                              &lt;/max:CREATIONDATE&gt;
                              &lt;max:DESCRIPTION changed=""&gt;
                                  &lt;xsl:variable name="objOwner" select="/tTroubleticket/mc_object_owner" /&gt;
                                  &lt;xsl:variable name="mcOwner" select="/tTroubleticket/mc_owner" /&gt;
                                  &lt;xsl:value-of select="concat($objOwner,'|',$mcOwner)" /&gt;
                              &lt;/max:DESCRIPTION&gt;
                              &lt;/max:MXINCIDENT_WST&gt;
                      &lt;/max:MXINCIDENT_WSTBSet&gt;
                  &lt;/max:CreateMXINCIDENT_WSTB&gt;
              &lt;/soapenv:Body&gt;
          &lt;/soapenv:Envelope&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Here is XSLT util class which I am using for transforming/mapping my XML and XSL 
  files. In the below java file I am reading the xsl file from my local directory. Once I deploy my jar to JBoss server, I pass read the file location and pass it to XSLTFilename variable.</p>
  
  <pre><code>package com.al.ddr.fsw.tt.util.xml.transform;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.StringReader;
  import java.io.StringWriter;
  import com.al.ddr.common.logging.jb.Logger;    
  import javax.xml.transform.Source;
  import javax.xml.transform.Transformer;
  import javax.xml.transform.TransformerException;
  import javax.xml.transform.TransformerFactory;
  import javax.xml.transform.TransformerFactoryConfigurationError;
  import javax.xml.transform.stream.StreamResult;
  import javax.xml.transform.stream.StreamSource;
  
  public class XSLTUtil {
  
      Logger logger = Logger.getLogger(XSLTUtil.class);
      //Logger logger = Logger.getLogger("XSLTUtil");
  
      public String transformXML(String inXML, String XSLTFilename) throws TransformerFactoryConfigurationError, TransformerException {
          StringWriter xmlResultResource = new StringWriter();
          try {
              Source xslDoc = new StreamSource(XSLTFilename);
              Transformer transformer = TransformerFactory.newInstance().newTransformer(xslDoc);
              transformer.transform(new StreamSource(new StringReader(inXML)), new StreamResult(xmlResultResource));
              //logger.info("XSLTUtil",0,"XSLTUtil - transformXML() - Result : \n" + xmlResultResource.getBuffer().toString(),"");
          } catch (TransformerException e) {
              //logger.error("XSLTUtil",0,"TransformerException : Error occured while transforming xml with the xslt file : \n"+e.getMessage(),"");
          } catch (Exception e) {
              e.getMessage();
              //logger.error("XSLTUtil",0,"Error occured while transforming xml with the xslt file : \n"+e.getMessage(),"");
          }
          return xmlResultResource.getBuffer().toString();
      }
  
      public static void main(String[] args) throws TransformerFactoryConfigurationError, TransformerException {
  
          String xmlSourceResource = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?&gt;" + "&lt;tTroubleticket&gt;" + "&lt;alarms&gt;" + "&lt;tTroubleTicketAlarm&gt;" + "&lt;alarmid&gt;3117&lt;/alarmid&gt;"
                  + "&lt;alarmName&gt;OSS&lt;/alarmName&gt;" + "&lt;/tTroubleTicketAlarm&gt;" + "&lt;tTroubleTicketAlarm&gt;" + "&lt;alarmid&gt;3118&lt;/alarmid&gt;" + "&lt;alarmName&gt;OS123&lt;/alarmName&gt;" + "&lt;/tTroubleTicketAlarm&gt;"
                  + "&lt;/alarms&gt;" + "&lt;interactiondate&gt;2014-11-21 11:22:34&lt;/interactiondate&gt;" + "&lt;troubleticketstate&gt;QUEUED&lt;/troubleticketstate&gt;"
                  + "&lt;mc_object_owner&gt;amit&lt;/mc_object_owner&gt;"+ "&lt;mc_owner&gt;kumar&lt;/mc_owner&gt;"
                  + "&lt;troubledescription&gt;Server down&lt;/troubledescription&gt;" + "&lt;system&gt;IRU&lt;/system&gt;" + "&lt;subsystem&gt;FJKH&lt;/subsystem&gt;" + "&lt;severity&gt;1&lt;/severity&gt;" + "&lt;tecGroup&gt;NSN&lt;/tecGroup&gt;"
                  + "&lt;block&gt;block&lt;/block&gt;" + "&lt;subBlock&gt;sub_block&lt;/subBlock&gt;" + "&lt;history&gt;new ticket created&lt;/history&gt;" + "&lt;Log&gt;" + "&lt;Logname&gt;FJKH&lt;/Logname&gt;" + "&lt;LogSize&gt;Nothing&lt;/LogSize&gt;"
                  + "&lt;LogFile&gt;" + "Hi" + "&lt;/LogFile&gt;" + "&lt;/Log&gt;" + "&lt;/tTroubleticket&gt;";
  
          String xsltFilename = "C:/Users/akuma249/TTSimulator/aor-platform-tt/src/config/xslt_COLOMBIA/v11/CreateTicketRequest_WS_11.xsl";
  
          XSLTUtil util = new XSLTUtil();
          String transformedXML = util.transformXML(xmlSourceResource, xsltFilename);
          System.out.println(transformedXML);
  
      }
  
  }
  </code></pre>
  
  <p>This particular piece of code works fine in my workspace.
  Do I need to configure something on my JBoss server in order to fix the issue?
  Please let me know what exactly I am missing.</p>