Author |
Message
|
anon_kb |
Posted: Thu Jul 16, 2015 10:08 pm Post subject: [CRLF]CARRIAGE RETURN [SOLVED] |
|
|
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 |
|
 |
smdavies99 |
Posted: Fri Jul 17, 2015 12:27 am Post subject: |
|
|
 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 |
|
 |
anon_kb |
Posted: Fri Jul 17, 2015 1:12 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Jul 17, 2015 4:34 am Post subject: |
|
|
 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 |
|
 |
anon_kb |
Posted: Fri Jul 17, 2015 4:39 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Fri Jul 17, 2015 10:55 am Post subject: |
|
|
 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 |
|
 |
anon_kb |
Posted: Sun Jul 19, 2015 7:54 pm Post subject: |
|
|
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 |
|
 |
anon_kb |
Posted: Sun Jul 19, 2015 10:52 pm Post subject: |
|
|
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 |
|
 |
anon_kb |
Posted: Mon Jul 20, 2015 2:06 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Mon Jul 20, 2015 12:45 pm Post subject: |
|
|
 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 |
|
 |
smdavies99 |
Posted: Mon Jul 20, 2015 10:25 pm Post subject: |
|
|
 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 |
|
 |
joebuckeye |
Posted: Tue Jul 21, 2015 4:18 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Tue Jul 21, 2015 5:50 am Post subject: |
|
|
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 |
|
 |
|