ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML output with CRLF after closing tag

Post new topic  Reply to topic
 XML output with CRLF after closing tag « View previous topic :: View next topic » 
Author Message
manoj5007
PostPosted: Wed May 15, 2013 10:52 pm    Post subject: XML output with CRLF after closing tag Reply with quote

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
View user's profile Send private message
praj1740
PostPosted: Wed May 15, 2013 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
manoj5007
PostPosted: Wed May 15, 2013 11:47 pm    Post subject: The requirement is there Reply with quote

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
View user's profile Send private message
rekarm01
PostPosted: Thu May 16, 2013 12:07 am    Post subject: Re: The requirement is there Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu May 16, 2013 5:10 am    Post subject: Re: The requirement is there Reply with quote

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
View user's profile Send private message
Tibor
PostPosted: Thu May 16, 2013 6:40 am    Post subject: Reply with quote

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
View user's profile Send private message
manoj5007
PostPosted: Sun May 19, 2013 9:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sun May 19, 2013 9:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Sun May 19, 2013 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
manoj5007
PostPosted: Tue May 21, 2013 2:39 am    Post subject: RE:In CCSID 1208 shouldn't that be x'0d0a' as in CRLF ? Reply with quote

Acolyte

Joined: 15 May 2013
Posts: 64

You are right. Its X'0D0A' FOR CRLF AND X'0A' for LF alone.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML output with CRLF after closing tag
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.