Author |
Message
|
ferloz |
Posted: Mon Oct 10, 2005 4:58 am Post subject: Strange problem about attributes ... |
|
|
 Novice
Joined: 26 May 2005 Posts: 23
|
Hi all,
i've a strange question about XML atrributes .
In the following input message the type attribute appear
in the mSwCriteriaA tag .
<Payload>
<mTaskRefS>mytask_2</mTaskRefS>
<mSwCriteriaA type="com.swift.inaws.swclasses.SwTaskCriterium">
.....
But after the MQINPUT node the XML seem to be the following one :
<mSwCriteriaA>
<type>com.swift.inaws.swclasses.SwTaskCriterium</type>
<mValueS>U</mValueS>
The properties of the node are :
Message domain XML
Message Set / Type / Format : blank.
Anyone can suggest where i'm wrong ?
Thanks
P. _________________ fkid |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 10, 2005 5:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You haven't read the documentation and understood the difference between the physical message and the logical message tree. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ferloz |
Posted: Mon Oct 10, 2005 5:05 am Post subject: |
|
|
 Novice
Joined: 26 May 2005 Posts: 23
|
Thanks i'll look in this direction.
Paolo _________________ fkid |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 10, 2005 5:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
XML.Attribute is merely a different physical format for a logical element.
If you used the Trace node and wrote out to a file, you'd see that the number before type was different than the number before Payload. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ferloz |
Posted: Mon Oct 10, 2005 5:14 am Post subject: |
|
|
 Novice
Joined: 26 May 2005 Posts: 23
|
Sorry again.
My "empasse" with the english language don't give me the capability to be clear as i want .
The problem i have is generate in a complex flow (i'm writing ) that take from an MQINPUT an xml message, create an envelope in XMLNS and imbed the <Payload> tag ( with it's structure ) into the message itself . After this "remap" reset the node content and write out the new message .
The two examples in the firt note of the topic are on the two edges ( in and Out).
Please accept my excuses if i was rude ..
Paolo _________________ fkid |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 10, 2005 5:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Nah. Excuse me for misunderstanding.
This is mostly simple.
Set the Input node to XMLNS - it will handle non-namespaced XML just fine (and the XML domain is being phased away).
Then write ESQL to create the output message you want, by creating new fields in OutputRoot and then copying from InputRoot. Use CopyMessageHeaders not CopyEntireMessage. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ferloz |
Posted: Tue Oct 11, 2005 5:06 am Post subject: |
|
|
 Novice
Joined: 26 May 2005 Posts: 23
|
Dear jefflowrey,
you gave me the right idea.
Following your suggestion i've inserted a trace node just after the MQInput node and another before the MQPut .
The results are in line with your first comment ( different record ID ) like this one ( post MQGet ) :
Quote: |
(0x01000000):Payload = (
(0x02000000): = '
'
(0x01000000):mTaskRefS = (
(0x02000000): = 'mytask_2'
)
(0x02000000): = '
'
(0x01000000):mSwCriteriaA = (
(0x03000000):type = 'com.swift.inaws.swclasses.SwTaskCriterium'
(0x02000000): = '
'
|
For passing without problems thru the different stages i'm saving the input area in an environment variable .
You can see below the result :
Quote: |
(0x01000000):Payload = (
(0x03000000):mTaskRefS = 'mytask_2'
(0x01000000):mSwCriteriaA = (
(0x03000000):type = 'com.swift.inaws.swclasses.SwTaskCriterium'
(0x03000000):mValueS = 'U'
(0x03000000):mOperatorS = 'EQL'
(0x03000000):mFieldNameS = 'DEAL_Deal_Status'
(0x03000000):mKeywordS = ''
)
|
and this is the code:
Quote: |
if trim(InputRoot.XMLNS.ExchangeArea.Payload) <> '' then
set Environment.Variables.User.Payload = InputRoot.XMLNS.ExchangeArea.Payload;
else
set Environment.Variables.User.Payload[] = InputRoot.XMLNS.ExchangeArea.Payload[] ;
end if;
|
Can you suggest me where i've the bug.
thanks a lot in advance.
Paolo _________________ fkid |
|
Back to top |
|
 |
mgk |
Posted: Tue Oct 11, 2005 6:22 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
When you execute this line:
set Environment.Variables.User.Payload = InputRoot.XMLNS.ExchangeArea.Payload;
This does not copy the parser from the source to the destination. To make this work you must create an XMLNS (in your case) parser in the Environment tree, something like:
CREATE LASTCHILD OF Environment.Variables DOMAIN 'XMLNS' NAME XMLNS
The you can do something like:
set Environment.Variables.XMLNS.User.Payload = InputRoot.XMLNS.ExchangeArea.Payload;
you only need to do this once, as the top of the your XMLNS tree in the environment.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|