|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
[URGENT] TDS message model |
« View previous topic :: View next topic » |
Author |
Message
|
leo.yue |
Posted: Thu Apr 13, 2006 8:18 am Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
juddg, sorry about that.
Here is the message that I ask you before
Quote: |
<CR><LF>01AAAA BBBB CCCC
<CR><LF>DDDD EEEE
<CR><LF>02Hello Blue Green White
<CR><LF>Red Yellow
<CR><LF>03Here is the Message
<CR><LF>For You
<CR><LF>04
<CR><LF> |
And the scenario changed, there is a A1 (optional, starting from A) between <CR><LF>01 and AAAA
Quote: |
<CR><LF>01A1 AAAA BBBB CCCC
<CR><LF>DDDD EEEE
<CR><LF>02Hello Blue Green White
<CR><LF>Red Yellow
<CR><LF>03Here is the Message
<CR><LF>For You
<CR><LF>04
<CR><LF> |
I got your help and it does work in a simple message (just like the message in this topic), but once I put this part into my messageset definition, it can not work normally, so...
How to change it based on your solution here
Code: |
Message - name = root
|
|-- complexType - DES = Use Data Pattern
| Group Terminator = <CR><LF>04
|
|-- sequence - DES = All Elements Delimited,
| | Group Indicator = <CR><LF>01
| | Delimiter = <CR><LF>
| | Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^2]))*
| |
| |-- sequence - maxOccurs = -1
| | DES = All Elements Delimited
| | Delimiter = <SP>
| |
| |-- element - maxOccurs = -1
Name = char
| Type = string
|
|-- sequence - DES = All Elements Delimited,
| | Group Indicator = <CR><LF>02
| | Delimiter = <SP>
| | Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^3]))*
| |
| |-- element - Name = action
| | Type = string
| |
| |-- element - Name = content
| Type = string
|
|-- sequence - DES = All Elements Delimited,
| Group Indicator = <CR><LF>03
| Delimiter = <CR><LF>
| Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^4]))*
|
|-- element - Name = msg
Type = string |
Sorry for having disturbed you. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Apr 13, 2006 12:39 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
And the scenario changed, there is a A1 (optional, starting from A) between <CR><LF>01 and AAAA |
Geoff knows that already. He gave you a solution to that. Your latest example message was different again.
Here is the message which you asked about at the start of this thread:
Quote: |
<CR><LF>A1 C1234 D1234 F1234
<CR><LF>02
A1 is optional |
...then you added an extra '01' after the <CR><LF>
Quote: |
<CR><LF>01A1 C1234 D1234 F1234
<CR><LF>02
A1 is optional |
...and here is the message which you are now asking about:
Quote: |
<CR><LF>01C1234 D1234
<CR><LF>F1234 |
Geoff and I would like to know why the space before F1234 has suddenly turned into <CR><LF>. |
|
Back to top |
|
 |
leo.yue |
Posted: Thu Apr 13, 2006 5:14 pm Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
kimbert, Thanks a lot.
I tried the solution provided by juddg and it does work in the following message
Quote: |
<CR><LF>01A1 C1234 D1234 F1234
<CR><LF>02
A1 is optional |
but, once there are some other text (e.g. <CR><LF>03Blue Green Yellow) followed by the sample message above, it will generate parsing error. |
|
Back to top |
|
 |
juddg |
Posted: Tue Apr 18, 2006 2:40 am Post subject: Combined message |
|
|
Apprentice
Joined: 22 Nov 2004 Posts: 33
|
Hi,
Assuming that you want the data modelled in the following structure:
Code: |
<a1>A1</a1>
<char>AAAA</char>
<char>BBBB</char>
.
.
|
The following model, that combines the models that I have posted previously, will parse your message into the above structure.
Code: |
Message - name = root
|
|-- complexType - DES = Use Data Pattern
| Group Terminator = <CR><LF>04
|
|-- sequence - DES = Use Data Pattern
| | Group Indicator = <CR><LF>01
| | Delimiter =
| | Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^2]))*
| |
| |-- sequence
| | | minOccurs = 0
| | | Data Element Separation = Use Data Pattern
| | | Data Pattern = (((A[^ ]{0,2})|ZZ) )
| | | Group Terminator = <SP>
| | |
| | |
| | |-- Name = a1
| | Data Pattern - [^ ]*
| |
| |
| |-- sequence - DES = All Elements Delimited,
| | Delimiter = <CR><LF>
| | Data Pattern =(\n|\r|.)*
| |
| |-- sequence - maxOccurs = -1
| | DES = All Elements Delimited
| | Delimiter = <SP>
| |
| |-- element - maxOccurs = -1
| Name = char
| Type = string
|
|-- sequence - DES = All Elements Delimited,
| | Group Indicator = <CR><LF>02
| | Delimiter = <SP>
| | Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^3]))*
| |
| |-- element - Name = action
| | Type = string
| |
| |-- element - Name = content
| Type = string
|
|-- sequence - DES = All Elements Delimited,
| Group Indicator = <CR><LF>03
| Delimiter = <CR><LF>
| Data Pattern =([^\r]|(\r[^\n])|(\r\n[^0])|(\r\n0[^4]))*
|
|-- element - Name = msg
Type = string
|
Regards,
juddg. |
|
Back to top |
|
 |
leo.yue |
Posted: Tue Apr 18, 2006 4:39 am Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
juddg, it's very nice of you!
Many many many thanks.  |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|