| Author |
Message
|
| sorn73 |
Posted: Thu Apr 08, 2004 5:04 am Post subject: Strip Whitespace when going from MRM to XML |
|
|
Novice
Joined: 24 Mar 2004 Posts: 24 Location: Sweden
|
I have a fixed length field message in an MRM tree that I more or less copy into an XML tree (not quite
| Code: |
| SET OutputRoot.XML.Root = InputBody |
but almost). However, in the incoming message all fields are padded with space. How can I efficiently remove the whitespace padding from the entire XML tree? Can I do it on the MRM side using the parser, with some flag in the message set? Can I do it using a SELECT instead of my SET? |
|
| Back to top |
|
 |
| jefflowrey |
Posted: Thu Apr 08, 2004 5:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You could
| Code: |
| Set OutputRoot.XML.Field1 = TRIM(InputBody.Field1); |
_________________ I am *not* the model of the modern major general. |
|
| Back to top |
|
 |
| sorn73 |
Posted: Thu Apr 08, 2004 5:38 am Post subject: |
|
|
Novice
Joined: 24 Mar 2004 Posts: 24 Location: Sweden
|
| Yes, but TRIM only works on STRINGS and not on entire subtrees... right? And I don't know the exact layout of the XML structure, with repeating elements etc. |
|
| Back to top |
|
 |
| jefflowrey |
Posted: Thu Apr 08, 2004 5:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There was code posted here quite a while ago to loop through an XML tree using references, and apply TRIM to every element.
Try searching for something like 'XML TRIM reference'. _________________ I am *not* the model of the modern major general. |
|
| Back to top |
|
 |
| fjcarretero |
Posted: Thu Apr 08, 2004 6:13 am Post subject: |
|
|
Voyager
Joined: 13 Oct 2003 Posts: 88
|
Hi,
When the broker parses the MRM message, you can try to set the padding char of every field to 'SPACE'. When parsing a message, the padding char is used as the character to trim.
Hope this helps.
Regards
Felipe |
|
| Back to top |
|
 |
|
|