Author |
Message
|
hampe98 |
Posted: Mon Aug 28, 2006 12:09 am Post subject: Tagged Delimited problems |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Hi All,
I´m trying to create a message set to support a format like this:
{header={type=abcd}|entry1={tag=value}|entry2={tag=value}|entry3={tag1=value|tag2=value.....
The problem I´m having is that you need to specify a tag name for each tag entry in the message and I can´t know how many "entry1...entry(n)" or "tag1..tag(n)" there will be in a message. There is a feature that allows you to use regexp for data but I need that same functionality to distinguish tags.
Any one got a clue how to go about this?
Regards,
Hampus |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 1:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Use two tags - "entry" and "1", "2", "3", etc. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 2:18 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
But I still don´t know how many 1, 2, 3 etc there are going to be.
It could be entry1..entry5, entry1..entry10 or entry1..entry1000.
I should be possible to use regexp on tha tag name as it is with data.
/Hampus |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 2:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you don't know how many there are going to be, then I hope you don't need to model 1 different than 2 - that they're all "entries", with the same structure.
So model the tag as "entry", and model the 1,2, etc as an integer. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 2:43 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Ok, how do I do that then? As for now I´m using a Data Element Separation of Tagged Delimited, Group Indicator {, Group Terminator } and Delimiter |
I only get an error saying that entry1 is an invalid member because I can´t create 1000 or more elements just to model 1000 or more tags that only differ by an incremented number.
The message looks like this:
entries={entry1={tag=value|tag2=value|tag3=value}|entry2={tag=value|tag2=value|tag3=value} ... {entry1000={tag=value|tag2=value|tag3=value}}
Regards,
Hampus |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 3:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You create a type for 'entry'. This will be a Tagged Variable Elements Delimited group. It will have two children - one a filler element that will hold the numbers and the "=". The second will be a group for the children, that will have group indicator { and group delimiter }, and a delimiter of |.
The message group will hold an element of the 'entry' type, which will have a tag of "entry". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 3:20 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Ok, but I can´t find a "Tagged Variable Elements Delimited" group. I´m using WBIMB 5.x.
/Hampus |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 3:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's the Data Element Separation. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 4:03 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Yes, but I can´t find a Data Element Separation -type which is named "Tagged Variable Elements Delimited".
I´ve got:
Tagged Delimited
Tagged Fixed Length
Tagged Encoded Length
All Elements Delimited
Variable Length Elements Delimited
etc etc |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 4:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
hampe98 wrote: |
Variable Length Elements Delimited |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 5:42 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Can´t get it to work. Do you know if there are any good documentation in handling such cases?
Thanks for all your help!
Regards,
Hampus |
|
Back to top |
|
 |
kimbert |
Posted: Mon Aug 28, 2006 6:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Not a straightforward scenario, but it ought to be possible. As you have suggested, the main problem is dealing with the integer suffix on the tag names. TDS does not have an automatic way of doing this, so you will need to embed a group with Data Element Separation 'Use Data Pattern' to consume the suffix.
Something like
Code: |
Group Name=RepeatingEntry Data Element Separation=Use Data Pattern
Element Name='Entry' Data Pattern='entry\d+' ( I think \d is the correct way to specify a digit. It's in the docs anyway)
|
Put a reference to this group in place of your current 'entry' element.
Iterate until you achieve success!
Let us know how you get on. This post was done in a hurry! |
|
Back to top |
|
 |
hampe98 |
Posted: Mon Aug 28, 2006 11:50 pm Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
Well, that seems to work. The broker identifies the element but throws an exception saying that an group indicator is missing at a specified position. The problem is that there is a group indicator at that position.
Any clues?
I appreciate all the help.
/Hampus |
|
Back to top |
|
 |
kimbert |
Posted: Tue Aug 29, 2006 3:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You will need to consume the '=' after the 'entryNN' so try adding it to the pattern: 'entry\d+='.
You might want to check whether the '=' needs to be escaped by a backslash when used in a data pattern. |
|
Back to top |
|
 |
hampe98 |
Posted: Tue Aug 29, 2006 3:27 am Post subject: |
|
|
Novice
Joined: 28 Aug 2006 Posts: 10
|
I´ve tried that but it still doesn´t work. Same complaint as before about a missing group indicator. |
|
Back to top |
|
 |
|