Author |
Message
|
tlandich |
Posted: Mon Aug 19, 2002 3:44 pm Post subject: Problem: Cannot copy XML attributes in the Environment tree |
|
|
Novice
Joined: 23 Jul 2002 Posts: 11
|
There seems to be a bug in WMQI V2.1 CSD 2, where the XML attributes become XML child elements when copied from the input tree to the environment tree. Also the attributes of leaf nodes get dropped!
To illustrate this problem, you can test the following code in a compute node.
SET Environment.XML = InputRoot.XML;
SET OutputRoot.XML = Environment.XML;
This should be a straightforward copy. But for example, if your input XML looked like this:
<?xml version="1.0" encoding="UTF-8"?>
<Tests>
<Test1 testattr="1">
<Tag1 tag1attr1="attr1val" tag1attr2="attr2val">
<Tag3 tag3attr1="attr1val" tag3attr2="attr2val">Tag3Val</Tag3>
Tag1Val
</Tag1>
</Test1>
<Test2 testattr="2">
<Tag2 tag2attr1="attr1val" tag2attr2="attr2val">Tag2Val</Tag2>
</Test2>
</Tests>
Then the output unexpectedly becomes:
<Tests>
<Test1>
<testattr>1</testattr>
<Tag1>
<tag1attr1>attr1val</tag1attr1>
<tag1attr2>attr2val</tag1attr2>
<Tag3>Tag3Val</Tag3>
</Tag1>
</Test1>
<Test2>
<testattr>2</testattr>
<Tag2>Tag2Val</Tag2>
</Test2>
</Tests>
HELP! Does anyone know of a workaround? Is IBM planning to fix this bug in the next CSD?
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Mon Aug 19, 2002 6:58 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Have you tried storing XML message as BLOB into Environment Tree and then retrieve the same message into InputBody as BLOB and then apply XML parser to it?
I have not tested this myself, but I don't see any reason why it shouldn't work!
For example,
In one compute node, store XML message as BLOB into Environment Tree.
SET Environment.XML = BITSTREAM(InputBody);
In another compute node, build BLOB message body.
SEt OutputRoot."BLOB"."BLOB" = Environment.XML;
Use RCD to reset message domain to XML. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
warrenpage |
Posted: Mon Aug 19, 2002 7:13 pm Post subject: But we want the tree not the BLOB |
|
|
Acolyte
Joined: 19 Feb 2002 Posts: 56 Location: Australia
|
Thanks for the response Kiran but we don't want the XML BLOB, we want the tree and its hierarchy. It is a parameter file we use to drive the flow.
We could (and might) change all the attributes to elements to get around it. This does not however change the fact that this doesn't work in WMQI.
Do you know if anyone plans on fixing this in a CSD.
Warren |
|
Back to top |
|
 |
kirani |
Posted: Mon Aug 19, 2002 7:44 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Your tree hierarchy will be maintained when your data is stored into Environment Tree using BITSTREAM function. Are you planning on referring to this data into Environment Tree within your message flow? Why would you want to create/store Attributes in Environment Tree?
You could get rid of RCD node by using CREATE ... PARSE function call.
You might want to have a look at thread,
http://www.mqseries.net/phpBB2/viewtopic.php?t=3450
You could report this problem to IBM and see what they have to say about this. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
kwelch |
Posted: Fri Aug 23, 2002 12:24 pm Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
Hi,
We did report this as a problem to IBM and they gave us a work around which did not work for us.
My understanding was you could store your input into the Environment tree and it would recognize the attributes, but it's when you go to try to move these in a group type of move that things get messed up. The only way we could get this to work was to format our output in the Environment without the attributes and then inidividually set the attributes in the very last compute node of the messageflow.
Karen |
|
Back to top |
|
 |
CodeCraft |
Posted: Fri Aug 23, 2002 11:19 pm Post subject: |
|
|
Disciple
Joined: 05 Sep 2001 Posts: 195
|
You should be able to do this but storing the elements under an XML root in the environment tree.
You may have to fiddle to get it work:
Set OutputLocalEnvironment.XML = InputRoot.XML
You could also try creating a node in the OutputLocalEnvironment using the create statement with parser domain XML. |
|
Back to top |
|
 |
kwelch |
Posted: Mon Aug 26, 2002 4:27 am Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
I beleive the last thing you mentioned, using the create and specifying the domain as xml was what IBM recommended. We were never successful at getting this to work, even though IBM saw our code and said it 'should' work we could not get it to work.
Karen |
|
Back to top |
|
 |
|