Author |
Message
|
TonyD |
Posted: Tue Nov 08, 2005 11:56 pm Post subject: TDS Help please! |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
We have an internally designed message structure that looks like:
Code: |
<BUSMSG>
<AAA>11:222:::333:4</AAA>
<BBB>:::555</BBB>
<AAA>66:777</AAA>
<GRP>
<BBB>88888::99999</BBB>
<CCC>111:222</CCC>
<AAA>33::::44</AAA>
</GRP>
</BUSMSG>
|
There are XML tags, which may have attributes, which contain ':' delimited data. The XML tags, and there are many, can appear in any sequence, and as shown in the example, can be grouped inside a <GRP> tag.
Our current solution involves processing the <> tags as an XML message and then extracting each of the colon-delimited strings and TDS-parsing them as if they were separate messages. It works OK but I have been trying to work out whether it is possible to parse the entire message as TDS. So far I have been unsuccessful in my attempts to specify the TDS properties for the XML-like tags. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 09, 2005 4:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm sorry to say that is a horrible data design. It would be so much better to put each individual piece of data in it's own tag - it is probably a false economy to "save characters" by using fewer tags.
I don't think you can do anything other than mix using substring and position.
You might be able to do stuff with multi-part messages... but you'll have to go back to the manuals and see, as I don't know for sure if it can be done or how to do this. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 09, 2005 4:53 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
So far I have been unsuccessful in my attempts to specify the TDS properties for the XML-like tags |
You could try this:
- Create a global element to represent each tag
- On each global element, set the 'Tag' property to '<AAA>' (or whatever)
- On the complex type for each global element, set the Group Terminator to </AAA> ( or whatever ).
- For the outermost tag, do the same, and also set the Data Element Separation on its complex type to 'Tagged Delimited'.
The above technique assumes that the incoming XML is organised as lines of text, one tag per line, no blank lines. If these conditions are not met, it may still be possible to do what you want, but it might not be worth the effort. |
|
Back to top |
|
 |
TonyD |
Posted: Wed Nov 09, 2005 4:05 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
Quote: |
....that is a horrible data design...
|
Agreed!
Quote: |
You could try this:
- Create a global element to represent each tag
- On each global element, set the 'Tag' property to '<AAA>' (or whatever)
- On the complex type for each global element, set the Group Terminator to </AAA> ( or whatever ).
- For the outermost tag, do the same, and also set the Data Element Separation on its complex type to 'Tagged Delimited'.
|
I had done almost exactly the above, but had set 'Repeating Element Delimiter' in the Global Element to </AAA> (rather than in the Complex Type). I still have not worked out, from the mnemonic-related documentation, how to specify these tags in 'Group Indicator' and 'Group Terminator' ! All the examples have single character or symbol rather than a character string such as I have here. Could you suggest how I would represent '</AAA>' as a valid Group Terminator? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Nov 10, 2005 1:44 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
All the examples have single character or symbol rather than a character string such as I have here. Could you suggest how I would represent '</AAA>' as a valid Group Terminator? |
Fair point. You need to enter the tag as <LT>AAA<GT> and the Group Terminator as <LT>/AAA<GT>. |
|
Back to top |
|
 |
TonyD |
Posted: Thu Nov 10, 2005 2:43 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
Quote: |
You need to enter the tag as <LT>AAA<GT> and the Group Terminator as <LT>/AAA<GT>
|
Thanks for that info!....I doubt that I would have worked that out. Will carry on experimenting along those lines. |
|
Back to top |
|
 |
kishoreraju |
Posted: Thu Nov 10, 2005 10:12 pm Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
<BUSMSG>
<AAA>11:222:::333:4</AAA>
<BBB>:::555</BBB>
<AAA>66:777</AAA>
<GRP>
<BBB>88888::99999</BBB>
<CCC>111:222</CCC>
<AAA>33::::44</AAA>
</GRP>
</BUSMSG>
i think it's deficult to define a message set for this(impossible) because <AAA>11:222:::333:4</AAA>
<BBB>:::555</BBB>
<AAA>66:777</AAA> initially these are at the root lavel.
but in next repeatation these elements present in <GRP></GRP>.
Can u please check the structure of the message . |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Nov 11, 2005 1:22 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
kishoreraju : You could make a Complex Type to occur under the Root and use it also under some Child tags under the Root.....So that is not a problem.
But definitely this is a messed up Set....
I would like to know, is there anything in this set that is not dynamic.....i mean will there be only 'X' possible groups like AAA,BBB,CCC or BBB,AAA,AAA or CCC,AAA,BBB etc etc.........
Regards. |
|
Back to top |
|
 |
|