|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Syntax problem in EQSL |
« View previous topic :: View next topic » |
Author |
Message
|
Vitor |
Posted: Tue Mar 14, 2006 5:48 am Post subject: Syntax problem in EQSL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Hi all,
Can some kind person please take pity and point out the very obvious problem before I seriously damage this desk by hitting my head against it? I have the following XML fragment:
Code: |
.....
<Messages>
<Message code="info1">Something</Message>
</Messages>
...... |
which I'm trying to convert into
Code: |
.....
<Messages>
<Message><code>info1</code><text>Something</text></Message>
</Messages>
..... |
using either
Code: |
SET I = 1;
WHILE I <= CARDINALITY(InputRoot.XML.BusinessTransaction.BusinessTransactionBody.Messages.Message[]) DO
SET OutputRoot.XML.BusinessResponse.Payload.item.messages.vector.item[I].text
=InputRoot.XML.BusinessTransaction.BusinessTransactionBody.Messages.Message[I];
SET OutputRoot.XML.BusinessResponse.Payload.item.messages.vector.item[I].code =
FIELDVALUE(InputRoot.XML.BusinessTransaction.BusinessTransactionBody.Messages.Message[I].(XML.Attribute)code);
SET I = I + 1;
END WHILE;
|
or
Code: |
SET OutputRoot.XML.BusinessResponse.Payload.item.messages.vector.item[] =
(SELECT T AS text, FIELDVALUE(T.(XML.Attribute)code) AS code FROM InputRoot.XML.BusinessTransaction.BusinessTransactionBody.Messages.Message[] AS T);
|
The attribute appears in the output no problem as a tag called <code>. The problem is the <text> tag; as coded above it also contains the "code" as an attribute. If I use the XML.Content or XML.CDataSection qualifiers it gets a NULL with the trace claiming "Failed to navigate to path element".
What is the very stupid thing that I'm doing please? Having spent some hours failing to see it I'm about ready for a change in career (village idiot is sounding good but I'm doubting I can pass the exam ) but I'd just like to know what it is I'm missing.
This is on MQSI 2.1 with CSD09.
Thanks _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fschofer |
Posted: Tue Mar 14, 2006 7:12 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
have you tried to use FIELDVALUE also for der Message element ?
Code: |
OutputRoot.XML.BusinessResponse.Payload.item.messages.vector.item[I].text = FIELDVALUE(InputRoot.XML.BusinessTransaction.BusinessTransactionBody.Messages.Message[I]); |
Greetings
Frank |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 14, 2006 7:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Now I would have gone on oath that I'd tried that. Right hand on a stack of IBM manuals and sworn I'd tried that. Before I got desperate & started sequence typing my way through the various XML.* options.
Clearly delusional as well as stupid! Either I thought to try it and didn't, or tried it and somehow failed to notice it working.......
Many, many thanks for your assistance with this. I'm just off to make a few notes on doing buttons up in case this new, strange medical condition is worse by tomorrow morning.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|