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 » [CRLF]CARRIAGE RETURN [SOLVED]

Post new topic  Reply to topic
 [CRLF]CARRIAGE RETURN [SOLVED] « View previous topic :: View next topic » 
Author Message
anon_kb
PostPosted: Thu Jul 16, 2015 10:08 pm    Post subject: [CRLF]CARRIAGE RETURN [SOLVED] Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Hi guys,

I would just like to ask a question.
I have a flow on which the function was just to copy the input data a typical

SET OutputRoot = InputRoot;

My inputfile has an LF and I want to change it into CRLF. Any idea on how to do this? Thanks..


Last edited by anon_kb on Mon Jul 20, 2015 2:04 am; edited 1 time in total
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Jul 17, 2015 12:27 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

so you want to REPLACE something with something else
_________________
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
anon_kb
PostPosted: Fri Jul 17, 2015 1:12 am    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Hi thanks for your reply, I get your point. I deploy my Input file with LF and the output that had been displayed has only 1 line and the LF is gone.

Input
Code:
<?xml version="1.0" encoding="UTF-8"?><Test_Request>
  <Sequence>1</Sequence>
  <id>61992.2806.41790.52671</id>


Output
Code:
<?xml version="1.0" encoding="UTF-8"?><Test_Request><Sequence>1</Sequence><id>61992.2806.41790.52671</id>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 17, 2015 4:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Or set the parser to keep the whitespace (which it doesn't do by default) and set the output to UTF-8 or CCSID 1208...

By the way what's wrong with your current output (apart from the fact that it is just an XML fragment...)? The entire XML should be machine readable if it is only on one line... Nothing wrong with that...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
anon_kb
PostPosted: Fri Jul 17, 2015 4:39 am    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

fjb_saper wrote:
Or set the parser to keep the whitespace (which it doesn't do by default) and set the output to UTF-8 or CCSID 1208...

By the way what's wrong with your current output (apart from the fact that it is just an XML fragment...)? The entire XML should be machine readable if it is only on one line... Nothing wrong with that...


Hi fjb_saper, actually theres nothing wrong with it but the output will be used to another application and it might not able to handle the 1 line output especially if its a big file.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jul 17, 2015 10:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
the output will be used to another application and it might not able to handle the 1 line output especially if its a big file
Please can you explain those concerns in more detail?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
anon_kb
PostPosted: Sun Jul 19, 2015 7:54 pm    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Deployment:
Deploying on Unix Environment


Parser

BLOB

Situation:
I have a flow that has a function on just copying an input xml. No mapping required.
Input XML has a Linefeed on every XML Elements.

Issue:
Result is on 1 Line. Line Feed is gone.
The output will be use to another application and it might not able to handle a big size 1 line output.

TODO:
Change Linefeed into a Carriage Return.
Make sure its not on one line.

So far this is the solutions i've done

Code:
CREATE FIRSTCHILD OF OutputRoot.XMLNSC.Test_Request.Sequence TYPE Value VALUE CAST (X'0D0A2020' AS CHARACTER CCSID 1208);
CREATE LASTCHILD OF OutputRoot.XMLNSC.Test_Request TYPE Value VALUE CAST (X'0D0A' AS CHARACTER CCSID 1208);


Result: CRLF appears only on the Test_Request tag

Code:
DECLARE CF CHAR CAST(X'0A0D' as Character CCSID InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding);


Result: Still wont work.

Thanks for your suggestions and help.
[/list]
Back to top
View user's profile Send private message
anon_kb
PostPosted: Sun Jul 19, 2015 10:52 pm    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

I've tried to set the delimeter in my file output node and still same output, no CRLF appears in every element.
Back to top
View user's profile Send private message
anon_kb
PostPosted: Mon Jul 20, 2015 2:06 am    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Hi guys, case closed. Oh my. Sorry for the hassle its all in the File Output Node properties. I am sorry again. THank you for the guidance.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jul 20, 2015 12:45 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You may have wasted several hours of your time fixing a non-existent problem. What evidence do you have to back up this assertion?
Quote:
the output will be used to another application and it might not able to handle the 1 line output especially if its a big file
XML is not a line-oriented format ( despite what your experience might lead you to believe ). I have worked on several different XML parsers, and not one of them treats its input as a sequence of lines. The XML specification does not discuss the concept of a 'line' at all.

btw, I'm not claiming that large XML files are never a problem. I am claiming that the presence of line breaks ( and any other white space that occurs between the end of one tag and the start of the next) is irrelevant.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Jul 20, 2015 10:25 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.

I have seen some XML interpreters (not parsers) that were written by people who did not understand the basic principles of parsing.
One of these was used where the IT Managers decided that it was better to roll their own rather than use something like the XERCES parser because that was open source and no one would support it.
Luckily the XML they were having to interpret was a very limited subset of the full spec. No attributes and all data was string types.

Yes it worked and relied upon a CR/LF to detect the end of line/end of tag.

That was a long time ago though. Perhaps in some places that sort of mentality still rules?
_________________
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
joebuckeye
PostPosted: Tue Jul 21, 2015 4:18 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

It can be amazing to find places that say they accept XML messages and then when working with them you find out that they have created their own XML parser that is very limited.

I recently worked with a vendor that was concerned because we were sending XML tags in different formats and it was causing them problems.

The different format issue? One consumer of our service (I work in the SOA layer) was passing in an XML with a namespace prefix defined and another consumer was using the default namespace (so no prefix). The vendor kept trying to tell us to fix our "bug" and to send it all the same way.

I would always responded that those formats were logically equivalent and that any decent XML parser would handle them without issue. We don't get those questions from that vendor anymore.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jul 21, 2015 5:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

joebuckeye wrote:
any decent XML parser would handle them without issue.


Any standards compliant XML parser...
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 » [CRLF]CARRIAGE RETURN [SOLVED]
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.