ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem: Cannot copy XML attributes in the Environment tree

Post new topic  Reply to topic
 Problem: Cannot copy XML attributes in the Environment tree « View previous topic :: View next topic » 
Author Message
tlandich
PostPosted: Mon Aug 19, 2002 3:44 pm    Post subject: Problem: Cannot copy XML attributes in the Environment tree Reply with quote

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
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon Aug 19, 2002 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
warrenpage
PostPosted: Mon Aug 19, 2002 7:13 pm    Post subject: But we want the tree not the BLOB Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
kirani
PostPosted: Mon Aug 19, 2002 7:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Fri Aug 23, 2002 12:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
CodeCraft
PostPosted: Fri Aug 23, 2002 11:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
kwelch
PostPosted: Mon Aug 26, 2002 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem: Cannot copy XML attributes in the Environment tree
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.