Xp20:format-dateTime('060111','[Y01][M01][D01]') returns null...

As part of my tranformation I need to convert a date string into a datetime type. This operation kept returning null so I decided to hard code the value and the result is still null. Can anyone provide any insight?
XSL TRANFORMATION:
<order:OrderHdrAction>
<xsl:text disable-output-escaping="no">ADD
</xsl:text>
</order:OrderHdrAction>
<order:OrderHdrReqdt>
<xsl:value-of select="xp20:format-dateTime('060111','[Y01][M01][D01]')"/>
</order:OrderHdrReqdt>
<order:OrderHdrPonum>
<xsl:value-of select="/client:adage_orderentry_qdb_processorProcessRequest/client:flat_order/imp1:instruction/imp1:po_num"/>
</order:OrderHdrPonum>
RESULTANT XML:
<order:OrderHdrAction xmlns:order="http://www.shamrockfoods.com/adage/orderentry">ADD</order:OrderHdrAction>
<order:OrderHdrReqdt xmlns:order="http://www.shamrockfoods.com/adage/orderentry" />
<order:OrderHdrPonum xmlns:order="http://www.shamrockfoods.com/adage/orderentry">00001234</order:OrderHdrPonum>

i think this function is for formatting dates, and not parsing them as you are attempting. Try using substring instead.

Similar Messages

  • Xp20:format-datetime usage....

    Hello gurus,
    I am trying to use the xPath function format-datetime to get rid of the timezone from an input element, but in the output factional seconds is returning all zeroes. My picture string looks like below.
    xp20:format-dateTime($CreationDateTime,"[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f000001]")
    eg: Input: 2011-01-07T09:35:03.624992-05:00
    Output: 2011-01-07T09:35:03.000000
    I am using 10.1.3.4 SOA and jdeveloper version.
    Any help is highly appreciated.
    Thanks in advance.
    Fub

    How do I set this though to format the date itself? i.e. I have set this up so far, xpath20:format-dateTime(xpath20:current-dateTime()), but what do I place in the last set of parenthesis that allows me to achieve this?

  • Xp20:format-dateTime with milli seconds always as zeroes

    Hi All,
    I am trying to use the xPath function format-datetime , but in the output factional seconds is returning all zeroes. My picture string looks like below.
    *xp20:format-dateTime(xp20:current-dateTime(),"[H01][m01][s01][f001]*
    Result always in zeroes see example below:
    *105017000*
    Do somebody have some advice on this issue?

    Use ora:getCurrentDateTime() extension function instead... It accepts java SimpleDateFormat patterns and it is able to go milliseconds...
    Cheers,
    Vlad

  • Xp20:format-dateTime method in BPEL 11g

    I am doing a date conversion as xp20:format-dateTime('2007-10-07','YYYYMMDD') and storing in a String variable - givenDateConverted
    but the result is as below
    <givenDateConverted >YYYYMMDD</givenDateConverted>
    My original requirement is to compare this givenDateConverted with the currentDate and reject if givenDateConverted is less than currentDate
    Please help
    Thanks
    Sesha

    Hi sesha,
    Your date 08-OCT-2009 is not in the expected xs:DateTime format like 2002-05-30T09:30:10Z
    This is what xp20:format-dateTime needs.
    What is the date format of the date you need to compare to the current date?
    If it is in the standard xsd:dateTime format you don't need to format anything.
    If it is a comparable format you can format the current time in that format.
    For example:
    <before>      
      <xsl:value-of select="xp20:format-dateTime(xp20:current-dateTime(),"[Y0001][M01][D01][H01][m01][s01]") > '20100909111209'"/>
    </before>see http://www.w3.org/TR/xslt20/#function-format-dateTime
    And beware of timezone issues...
    Groeten,
    HJH

  • Xp20:format-dateTime: How to use it

    Hi
    Can you tell me how to use this XPath function?? Give me an example please.
    I tried xp20:format-dateTime(xp20:current-dateTime(),'ddMMyyyy HHmm') but the result is
    "ddMMyyyy HHmm" (yes, the pattern itself!)
    Thanks
    Marcelo Menezes

    I don't know what the problem could be of this.
    xp20:current-dateTime() function returning time 1 hour ahead
    in this threads the guys are having the same problem (only different date function)

  • HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime a

    HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime as string, format as string). PLEASE HELP.

    If i look at the w3 org i would say :
    xp20:format-dateTime('yourfield','[D]-[[MN,*-3]-[Y]')
    or just MN will do too.

  • Add-dayTimeDuration-to-dateTime not working just before format-dateTime

    Hi,
    I am using format-DateTime function just after add-dayTimeDuration-to-dateTime function in XSLT mapping.
    But the response coming doesnot providing the result of add-dayTimeDuration-to-dateTime function.
    When I use both the functions individually then both works fine.
    Please let me know any solution for this.
    Thanks

    Hi Arpit,
    Can you try converting the output of add-dayTimeDuration-to-dateTime to string, before passing it to format-DateTime.
    Also can you post your piece of xslt that you are trying to work out with an example.
    Please do mention what exactly you are trying to do.
    I have tried this and its working fine.
    <xsl:value-of select="xp20:format-dateTime(string(xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'PT15S')),'[D01]/[M01]/[Y0001]')"/>
    Please let me know if this helps.
    Thanks,
    Deepak.

  • Transformation: format-dateTime

    Hi,
    I am stuck with transformation. I am trying to map a string column to a date column.
    Column name: imdtsc (String datatype)
    Value: 20080624054923
    For converting this string and for mapping to destination date field, I have used this function:
    <ns2:trxDate>
    <xsl:value-of select='xp20:format-dateTime(/top:F59432001Collection/top:F59432001/top:imdtsc,"[Y0001]-[M01]-[D01] [H01]:[m01]:[s01].0")'/>
    </ns2:trxDate>
    Here trxDate is my destination field of Date datatype.
    After deploying and instance creation I am not able to see any value in the table column trxDate.
    Can anyone help me in this. Am I doing something wrong. Is there any other way?
    Thanks,
    Abhishek...

    Thanks Anne for replying.
    I got the solution for my problem. Thanks to ramana.
    Here is my piece of code for this:
    <ns2:trxDate>
    <xsl:value-of select="concat(substring(/top:F59432001Collection/top:F59432001/top:imdtsc,1.0,4.0),&quot;-&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,5.0,2.0),&quot;-&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,7.0,2.0),'T',substring(/top:F59432001Collection/top:F59432001/top:imdtsc,9.0,2.0),&quot;:&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,11.0,2.0),&quot;:&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,13.0,2.0))"/>
    </ns2:trxDate>
    Cheers,
    Abhi...

  • XPath format-dateTime

    Hi,
    New in XPath.
    xp20:format-dateTime(string(2005-01-04)) <= xp20:format-dateTime(string(2005-01-05))
    This should be true, but it evaluation results false.
    What I´m doing wrong?
    Thanx

    You can use this functions as follows:
    <client:input>
    <xsl:value-of select="xp20:format-dateTime(/client:Sensors_JQProcessRequest/client:input,'[MM] [YYYY] [DD]')"/>
    </client:input>
    With input as - <input>2005-06-09T15:30:44.369</input>, you will get the output as <client:input>6 2005 9</client:input>
    But i dont think you can use this function for comparision, neither we have any xpath function for comparing datetime. You need to either write your own custom xpath function or you can use exec activity, write java code in that or use xp20:day-from-dateTime(), xp20:hours-from-dateTime(), xp20:year-from-dateTime(), xp20:minutes-from-dateTime(), xp20:seconds-from-dateTime() and compare them separately

  • Format-dateTime usage question

    Have a string input of 2007-10-10T10:10:10 am am attempting to use the format-dateTime XPath function in the XSLT Mapper to format the string uisng the string 'YYYY-MM-DDThh:mm:ss.SSS' - my output is simply the fomat string: 'YYYY-MM-DDThh:mm:ss.SSS'.
    Have looked at several threads on this but cannot find any help - what is going on and how do I use this function?
    Thanks - Casey

    Hopefully by now Casey has figured it out but in case someone else finds this thread...
    The date format used by the format-dateTime BPEL / ESB XPath extension function seems to be the same format string syntax specified in XSLT 2.0 format-date() function which is detailed with examples at: http://www.w3.org/TR/2005/WD-xslt20-20050915/#date-time-examples
    An example appears in this thread:
    Re: xp20:format-dateTime: How to use it

  • Xp20:current-dateTime() function returning time 1 hour ahead

    Do anyone know if the xp20:current-dateTime() function is incorrect? It is returning time 1 hour ahead, for example: when executed and put into a database, the column shows 2007-08-28 13:46:54.0, but the ESB flow was executed at about 12:46pm.
    Any help would be greatly appreciated.

    Check the timezone setting on your DB and the App server OS. They must be on different zones.
    --Shiv                                                                                                                                                                                                               

  • Xp20:current-dateTime dose not return actual time in daylight saving

    Hi,
    I have observed that xp20:current-dateTime dose not return the actual time in daylight saving. e.g. when the system time is 14:43:00 the xp20:current-dateTime function returns 15:43:00 i.e. additional 1 hour. Is this a known issue? How to prevent this from happening?
    Thanks in advance.

    Hello,
    I've the same problem. This occurs in BPEL middle tier instalation
    ( Linux x86 timezone set to Europe/Prague)
    and also in JDeveloper > Test xsl form. ( Localised Win XP SP2)
    BPEL version is 10.1.2.0.0.
    In our country we have now CEST ( Central European Summer Time) = GMT +2:00.
    xp20:current-dateTime returns for example 2006-06-27T13:10:15+01:00
    The time 13:10:15 is correct time in our timezone, but timezone +01:00 is not correct.
    Timezone should be +02:00. (?)
    When I insert this dateTime into database table, I have incorrect value there.
    Is there any way to solve this problem? ( any settings ...?)
    Regards
    Karel

  • Format-dateTime function in xsl

    Hi,
    I am trying to convert String format to specific date time format(YYYY-MM-DD HH24:MI:SS:FF).
    I am using below function in xsl:
    <xsl:value-of select='xpath20:format-dateTime(/ns0:Transmission/ns0:TransmissionBody/ns0:GLogXMLElement/ns0:ShipmentStatus/ns0:EventDt/ns0:GLogDate,"[Y0001][M01][D01][H01][m01][s01]")'/>
    But it is not returning any value.
    Source format is String(value= 20101020155400).
    Target is dateTime(Expected Value= 2010-10-20 01:55:40.0).
    Any suggestions will be helpful.
    Thanks

    Hi Arik....
    At last i got it. :)
    Followed the below steps.
    Step1:
    Created a String variable "currentDateTimeValue" in BPEL.
    Step2:
    I have used the below code in JavaEmbedding in BPEL.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
    //Date Pattern looks lil weird. But some Web service accepts only this format.
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
    String formattedDate = sdf.format(new java.util.Date());
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
    setVariableData("currentDateTimeValue", formattedDate);
    Step3:
    Created a Simple XSD with an element "DateElement" of String type.
    Step4:
    Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
    Step5:
    Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
    uh-huh I got the output...
    Thanks a ton ARIK :D u r really helpful...
    Regards,
    Sudheer

  • Reg : xp20:current-dateTime() gives error

    Hi,
    When i use xp20:current-dateTime() function in XSLT 1.0 inside OSB ( replace activity ), it works fine when used alone ,but gives following error when used with dn:lookupvalue functio ( custom xpath function)
    BEA-382513: OSB Replace action failed updating variable "body":
    java.lang.NoSuchMethodException: For extension function, could not find method
    oracle.tip.pc.services.functions.Xpath20.current-dateTime([ExpressionContext,] ).
    Checked both static and instance methods.
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    Please let me know any other datetime function which gives current date time in the following format
    2012-05-23T06:00:11+00:00
    or plz let me knoiw the solution to the above error

    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="XSD">
    <schema location="../xsd/CrediTransfer.xsd"/>
    <rootElement name="CreditTransferRequest" namespace="http://vodafone.com.mt/Siebel_Order_Creation"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="XSD">
    <schema location="../xsd/CrediTransfer.xsd"/>
    <rootElement name="CreditTransferResponse" namespace="http://vodafone.com.mt/Siebel_Order_Creation"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.5.0(build 110418.1550.0174) AT [FRI APR 06 15:04:12 IST 2012]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.sLabs.com/soa-utilities/osb/soa.utilities.dvm.LookupTable"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:soc="http://vodafone.com.mt/Siebel_Order_Creation"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:con="http://www.bea.com/wli/sb/stages/transform/config"
    xmlns:fn="www.w3.org/2004/07/xpath-functions/"
    exclude-result-prefixes="xsi xsl xsd soc bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap con fn">
    <xsl:template match="/">
    <xsl:variable name="ErrorMessage" select="/con:message"/>
    <!--
    <xsl:variable name="ErrorMessageTwo" select="fn:substring(ErrorMessage,1,4)"/>
    -->
    <soc:CreditTransferResponse>
    <soc:return>
    <soc:StandardResponse>
    <soc:success>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','Success','DefaultValue')"/>
    </soc:success>
    <soc:returnCode>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','returnCode','DefaultValue')"/>
    </soc:returnCode>
    <soc:message>
    <xsl:value-of select="substring($ErrorMessage,1,4)"/>
    </soc:message>
    <!--
    <soc:message>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','Message','DefaultValue')"/>
    </soc:message>
    -->
    <soc:date>
    <xsl:value-of select="xp20:current-dateTime()"/>
    </soc:date>
    </soc:StandardResponse>
    </soc:return>
    </soc:CreditTransferResponse>
    </xsl:template>
    </xsl:stylesheet>

  • Xp20:current-dateTime() and Milliseconds

    Hi
    Does anyone know how to obtain a dateTime to 1 tenth of a second?
    2007-07-06T09:11:48+00:00 is being returned from the above function and I need the date in the following format
    2007-07-06T09:11:48.1Z
    Many thanks
    Pete

    Hi Pete,
    Here's a sample BPEL process that fills a xs:string variable called currentDateTime with a formatted date/time string:
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
      Oracle JDeveloper BPEL Designer
      Created: Fri Jul 06 14:58:24 CEST 2007
      Author:  Bastiaan Schaap, Floris Automatisering
      Purpose: Asynchronous BPEL Process
    -->
    <process name="BPELProcess1"
             targetNamespace="http://xmlns.oracle.com/BPELProcess1"
             xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
             xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
             xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
             xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
             xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
             xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
             xmlns:client="http://xmlns.oracle.com/BPELProcess1"
             xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
             xmlns:ora="http://schemas.oracle.com/xpath/extension"
             xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
             xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions">
        <!--
            PARTNERLINKS                                                     
            List of services participating in this BPEL process              
        -->
        <partnerLinks>
            <!--
          The 'client' role represents the requester of this service. It is
          used for callback. The location and correlation information associated
          with the client role are automatically set using WS-Addressing.
        -->
            <partnerLink name="client" partnerLinkType="client:BPELProcess1"
                         myRole="BPELProcess1Provider"
                         partnerRole="BPELProcess1Requester"/>
        </partnerLinks>
        <!--
            VARIABLES                                                       
            List of messages and XML documents used within this BPEL process
        -->
        <variables>
            <!-- Reference to the message passed as input during initiation -->
            <!-- Reference to the message that will be sent back to the requester during callback -->
            <variable name="inputVariable"
                      messageType="client:BPELProcess1RequestMessage"/>
            <variable name="outputVariable"
                      messageType="client:BPELProcess1ResponseMessage"/>
            <variable name="currentDateTime" type="xsd:string"/>
        </variables>
        <!--
           ORCHESTRATION LOGIC                                              
           Set of activities coordinating the flow of messages across the   
           services integrated within this business process                 
        -->
        <sequence name="main">
            <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->
            <receive name="receiveInput" partnerLink="client"
                     portType="client:BPELProcess1" operation="initiate"
                     variable="inputVariable" createInstance="yes"/>
            <!--
              Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
            -->
            <bpelx:exec name="getFormattedCurrentDateTime" language="java"
                        version="1.4">
                <![CDATA[java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();         
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.S'Z'");         
    String formattedDate = sdf.format(new java.util.Date());         
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);        
    setVariableData("currentDateTime", formattedDate);]]>
            </bpelx:exec>
            <invoke name="callbackClient" partnerLink="client"
                    portType="client:BPELProcess1Callback" operation="onResult"
                    inputVariable="outputVariable"/>
        </sequence>
    </process>HTH,
    Bas

Maybe you are looking for

  • Help restore new hard drive via time machine back up in time capsule

    I have followed Pondini's How Do I Restore My Entire System from a backup on Time Capsule.  I get all the way to section G with No Problem.  I get to section H and my new Hard Drive does not appear in the Select a Destination box.  The icon indicatin

  • DB refresh btwn systems running on different OS versions

    Our SAP BW 3.5 is running on        - Development Environment - (MS SQL server 64-bit; virtualised)        - Production Environment - (MS SQL server 32-bit) Is it possible to do DB refresh of Development systen from Production with the above-mentione

  • Agent is not Assigned for step mail

    Hi, I am Getting the Error as No Agent for Step mail, Even i asigned in Recipient field as User with User name. Naveen

  • How to create swap partition on my mac

    Hi All, I am very new to MAC OS and I have VMWare installed on my MAC upon VMware running window7. And I am using Macbook Air with 8GB RAM the problem is I am running low RAM space and due to this system gets hugs all times. Rather than upgrading to

  • Windows7 64-bit can not detect my creative sb live 24-bit 7.1

    >windows7 64-bit can not detect my creative sb li've 24-bit 7. windows7 can not detect my creative sb li've 24-bit 7. I tried every thing updated my bios tried in device manager tried in any mode you like tried to install the latest drivers that supp