Author |
Message
|
Svp |
Posted: Fri Mar 12, 2010 1:15 pm Post subject: Problem with Adding a new Line in Text |
|
|
Apprentice
Joined: 18 Feb 2010 Posts: 40
|
I have a Message FLow which receives a XML message and store the
content of that message in a text file. I want to store each data in the XML
in a new line.
I referred the forum which discussed about adding new line to a e-mail output.
My ESQL looks like given below
DECLARE CR CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR );
SET L1 = 'Data1:'||Inputroot.XMLNSC.---.--||CR;
SET L2 = 'Data2:'||Inputroot.XMLNSC.---.--||CR;
SET FINAL = L1||L2;
I am not getting a newline in my output instead
I am getting all the message in a single line
-----Data1:(Msg)X'0a'Data1:(Msg)X'0a'
Is there any other way to add a new line or I have done anything wrong in my code? |
|
Back to top |
|
 |
Luke |
Posted: Sat Mar 13, 2010 12:06 am Post subject: Re: Problem with Adding a new Line in Text |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
Svp wrote: |
DECLARE CR CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR );
...
I have done anything wrong in my code? |
Your DECLARE is the problem - you shouldn't need to CAST twice, also when you CAST X'0A' to CHAR, I think you'll need to specify the CCSID.
Hope that helps ...
Luke |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 13, 2010 6:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
I truly don't understand your requirement.
If you want to see each part on it's own line use a browser or XML viewer to look at the XML.
XML is not designed to be human readable but is machine readable / parsable. So this should be no news to you... On top of this if you are preparing the output for an email program it should probably have x0d0a (CRLF) in it... unless your mailer transforms the LF into CRLF...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Sat Mar 13, 2010 12:06 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Quote: |
I am not getting a newline in my output instead
I am getting all the message in a single line |
Are you quite sure about that? Many Windows-based text editors will not recognise a single LF ( 0x0A ) as a linefeed. That would make the entire file appear as a single line.
If my guess is correct, please note that there are plenty of free text editors that handle linefeeds intelligently. |
|
Back to top |
|
 |
|