Author |
Message
|
udaya_isampalli |
Posted: Tue Mar 13, 2007 3:32 am Post subject: NewLine Character as Group Terminator is not working |
|
|
Novice
Joined: 09 Feb 2007 Posts: 13
|
i taking a TDS as input and XML as output for my message flow.
i am taking as newline as the Group Terminator that <CR><LF> and it worked fine.
but when i have taken this code to some other system at US it is not working i.e., it is not recognizing <CR><LF> as Group terminator.
please give some inputs to make my flow run. are do i need to use some other as new line charecter identifier than <CR><LF> |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue Mar 13, 2007 4:00 am Post subject: Re: NewLine Character as Group Terminator is not working |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
uday_MCA wrote: |
i taking a TDS as input and XML as output for my message flow.
i am taking as newline as the Group Terminator that <CR><LF> and it worked fine.
but when i have taken this code to some other system at US it is not working i.e., it is not recognizing <CR><LF> as Group terminator.
please give some inputs to make my flow run. are do i need to use some other as new line charecter identifier than <CR><LF> |
I dont know if it help you but new line code depends on OS.
Mac - 0A
Unix - 0D
Windows - 0D0A
So maybe it is the reason ( different OS of broker or input message new line encoding).
Marcin |
|
Back to top |
|
 |
kimbert |
Posted: Tue Mar 13, 2007 5:36 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Check your input message. You will probably find that it is using <LF> only ( or <CR> only ).
If you need to handle any or all of <CR><LF> and <LF> and <CR> as line terminators, I can provide a technique for doing that. But don't bother with that complexity unless your line terminator is genuinely unpredictable. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue Mar 13, 2007 5:43 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
kimbert wrote: |
If you need to handle any or all of <CR><LF> and <LF> and <CR> as line terminators, I can provide a technique for doing that. |
I'm very interested in this technique.
Please show us.
Because of this new line problems I dont use it as a separator.
Marcin |
|
Back to top |
|
 |
kimbert |
Posted: Tue Mar 13, 2007 8:31 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
It's quite simple. You just create extra nested groups, one per extra delimiter that you want to handle. Each group has a different Delimiter ( or, as is often the case, Repeating Element Delimiter ). Usually, one or more of the alternatives is a substring of another ( e.g. <CR> is a substring of <CR><LF> ).
This technique has another useful side-effect : it can cope with blank lines very elegantly ( as long as they only come one at a time ). Just include a nested innermost group which defines its Delimiter or RED as two occurrences of the usual delimiter. If you want to do this trick, make sure that the longest delimiters are applied to the outermost group, otherwise you lose a tiny bit of flexibility in your model.
The example below would handle any mixture of <CR><LF> or <CR> or <LF>. It would also handle cases where you get <CR><LF> immediately followed by <CR> or <LF>. :
Code: |
Message
Group [ DES=AED, maxOccurs=-1, RED=<CR><LF> ]
Group [ DES=AED, maxOccurs=-1, RED=<LF> ]
Group [ DES=AED, maxOccurs=-1, RED=<CR> ]
Element Line [Type=LineType, maxOccurs=1, DES=AED]
field1
field2
etc
|
Where
RED = Repeating Element Delimiter
DES = Data Element Separation
AED = All Elements Delimited |
|
Back to top |
|
 |
udaya_isampalli |
Posted: Tue Mar 13, 2007 8:44 pm Post subject: |
|
|
Novice
Joined: 09 Feb 2007 Posts: 13
|
thanks for the inputs.
i second environment i am trying to execute this flow is unix. so when i tried with <LF> as the Group Terminator to identify new line.
now the problem is as follows.
as i have each line suppose to produce one different file as output, with usage of <LF> it is not throwing error but all the output files are same what is there is first line of input file. does this <LF> move the cursor to starting of same line?
please provide some inputs on this |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 14, 2007 1:21 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
all the output files are same what is there is first line of input file. does this <LF> move the cursor to starting of same line? |
Have you put a Trace node into your flow to see what kind of message tree the parser has produced? If not, why not? |
|
Back to top |
|
 |
|