tags:

views:

600

answers:

2

Hi , I am able to display the contents of my incoming XML file using smooks in the freemarker template, but I want to add Current Date & time of my local system to identify the execution of my program.

<ftl:freemarker applyOnElement="CreditCard">
    <ftl:template><!--        <BalanceInquiryRequest>
        <TransactionId>${BalanceInquiryRequest.TransactionId}</<TransactionId>
        <ConfigurationId>${BalanceInquiryRequest.ConfigurationId}</ConfigurationId>
        <CardNumberr>${.vars["GiftCard"].CardNumber}</CardNumberr>
        <ExpirationDate>${.vars["GiftCard"].ExpirationDate}</ExpirationDate>
        <SecurityCode>${.vars["GiftCard"].SecurityCode}</SecurityCode>
       *****************************
Here I want to display the current Date & time 
    </BalanceInquiryRequest>
    --></ftl:template>
</ftl:freemarker>

Can you tell me how can I add current date & time in the XML without having an entry in the incoming XML.

+1  A: 

There seems to be an answer here. The short answer, you need to pass in Java.

Quinn DuPont
A: 

You cannot do it since XML like Freemarker are template engines, not objects. You have to pass it into the java object as new Date();

BoDiE2003