Author |
Message
|
manoj5007 |
Posted: Wed May 15, 2013 10:52 pm Post subject: XML output with CRLF after closing tag |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
How to create an xml output with a CR LF after a closing tag after a field,
i.e. <Test>
<A>
<B>xyz</B>
</A>
</Test> |
|
Back to top |
|
 |
praj1740 |
Posted: Wed May 15, 2013 11:17 pm Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
here there is no need of adding the carriage return and line feed since it deals all with the tags .We use in TDS and CWF messages depending on the requirement |
|
Back to top |
|
 |
manoj5007 |
Posted: Wed May 15, 2013 11:47 pm Post subject: The requirement is there |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
The requirement is that there should be a new line after every field's closing tag. |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu May 16, 2013 12:07 am Post subject: Re: The requirement is there |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
manoj5007 wrote: |
The requirement is that there should be a new line after every field's closing tag. |
Ok. The XMLNSC parser has an option to retain mixed content. |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 16, 2013 5:10 am Post subject: Re: The requirement is there |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
manoj5007 wrote: |
The requirement is that there should be a new line after every field's closing tag. |
That's a very stupid requirement from someone who doesn't understand XML properly. The only reason to do this is to make the XML human readable; any W3C compliant XML parser will ignore such whitespace.
Push back on this requirement & suggest to whoever gave it to you they open the XML in IE or some other tool when they want to look at it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Tibor |
Posted: Thu May 16, 2013 6:40 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
You can try something similar (not tested):
Code: |
DECLARE mblob BLOB CAST(InputBody AS BLOB CCSID 1208);
SET mblob = REPLACE(mblob, x'3e', x'3e0d0a');
SET OutputRoot.BLOB.BLOB = mBLOB;
|
It is for Windows-style line ending. |
|
Back to top |
|
 |
manoj5007 |
Posted: Sun May 19, 2013 9:39 pm Post subject: |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
Thank you all for the information.
I somehow convinced my partner that it isn't feasible and so used the below command in the places where he needed a LF.
CREATE LASTCHILD OF ReferenceElement TYPE Value VALUE CAST (X'0A' AS CHARACTER CCSID 1208); |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun May 19, 2013 9:56 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
In CCSID 1208 shouldn't that be x'0d0a' as in CRLF ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun May 19, 2013 10:02 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Or
O'1512
For us old timers who understand Octal
Code: |
12700
00015
12701
00012
60001
00004
|
Just something to brighten up this dull grey monday morning here in my bit of the UK. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
manoj5007 |
Posted: Tue May 21, 2013 2:39 am Post subject: RE:In CCSID 1208 shouldn't that be x'0d0a' as in CRLF ? |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
You are right. Its X'0D0A' FOR CRLF AND X'0A' for LF alone. |
|
Back to top |
|
 |
|