2

hi am working with wso2esb4.9.0,

I have a service which generates email in that i have property as mailbody which am using to pass as body of the email.

<property name="mailbody"
                   expression="fn:concat('You have received a new Ticket',':','TicketID-',get-property('Ticketid'),', ','TicketDetails-',get-property('Details'))"
                   scope="default"
                   type="STRING"/>

when am passing this property in my service am getting a mail and mail body looks like as shown below.

You have received a new Ticket: TicketID-3021668982752443, TicketDetails-Test ticket details

I want to add a new line in the value so that the mail body can look like below instead of a single line.

You have received a new Ticket: 

TicketID-3021668982752443, 
TicketDetails-Test ticket details

Is there any Xpath function or way to add new line to my string value.

I have tried to include \n and in fn-concat of mailbody property but it is not working.

Community
  • 1
  • 1
Nag
  • 357
  • 2
  • 9
  • 28
  • Have you tried using the encoded char for new line? : http://stackoverflow.com/questions/723226/producing-a-new-line-in-xslt – har07 Dec 04 '15 at 07:53

1 Answers1

5

As the XPath expression is inside of an XML document doing expression="fn:concat('You have received a new Ticket',':&#10;','TicketID-',get-property('Ticketid'),', ','TicketDetails-',get-property('Details'))" should suffice.

If you really use XPath 2.0 then you can also use expression="fn:concat('You have received a new Ticket',':', codepoints-to-string(10),'TicketID-',get-property('Ticketid'),', ','TicketDetails-',get-property('Details'))".

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
  • Hi @Martin Honnen, I am using jDev 11g and BPEL1.0. Both solutions are not working for me. I am using inside assign activity. Below is my code ==> concat('Dear XXXX,',codepoints-to-string(10), 'Your request ID XXXX has been approved. Kindly use below details for login. ',codepoints-to-string(10), codepoints-to-string(10),codepoints-to-string(10), 'User ID: XXXX',codepoints-to-string(10), 'Password: XXXX') – k10gaurav May 31 '17 at 06:49
  • Also I have tried ==> Also I tried ==> concat('Dear XXXX,',': ', 'Your request ID XXXX has been approved. Kindly use below details for login. ',': ', ': ',': ', 'User ID: XXXX',': ', 'Password: XXXX') but no luck! – k10gaurav May 31 '17 at 06:51