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 » assign the i/p xml msg to an attribute of o/p xml msg

Post new topic  Reply to topic
 assign the i/p xml msg to an attribute of o/p xml msg « View previous topic :: View next topic » 
Author Message
nu1
PostPosted: Fri Feb 13, 2004 7:07 am    Post subject: assign the i/p xml msg to an attribute of o/p xml msg Reply with quote

Apprentice

Joined: 28 Nov 2003
Posts: 26

Hi,
I am getting an XML message message I want to assign a child node which has many attributes and child elements as the text content to an attribute of a child element of o/p xml message.
i/e.,
if I get
<parent>
<child1 attr1="xxx" attr2="yyy">
<sub1-child1>sub1-child1text</sub-child1>
<sub2-child1 attr1="bvj" attr2="yuiy">sub2-child2text</sub2-child1>
</child1>
<child2>child2text</child2>
<child3> child3text
</parent>

I want to send it as
<ABC>
<abcchild1 attr1='<child1 attr1="xxx" attr2="yyy"><sub1-child1>sub1-child1text</sub-child1><sub2-child1 attr1="bvj" attr2="yuiy">sub2-child2text</sub2-child1></child1>'>
</abcchild1>
<abcchild2>abcchild2text</abcchild2>
</ABC>

I am trying to copy each element and its attributes to some char variable and then assigning it to the attribute of child element of o/p xml message.
This is becoming very complex as I dont know how the child element is going to be. I am tring to use dynamic reference.

Please kindly let me know if you have some ideas.

Thanks
_________________
-nu1
Back to top
View user's profile Send private message
Missam
PostPosted: Fri Feb 13, 2004 11:17 am    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Why are you copying attribute's to varaibles.you can directly assing attributes of one element to attributes of other.
Back to top
View user's profile Send private message
nu1
PostPosted: Fri Feb 13, 2004 12:09 pm    Post subject: Reply with quote

Apprentice

Joined: 28 Nov 2003
Posts: 26

The entire child element cannot be copied as an attribute of outputchild element.
Please kindly see my i/p and o/p that i wanted once again.
if I have an child element say
<child1 attribute1="sdssd" attributute2="vsdfsdf">

while sending this
I want something like
<out>
<aaaa attribute1='<child1 attribute1="sdssd" attributute2="vsdfsdf">' />
</out>
_________________
-nu1
Back to top
View user's profile Send private message
wooda
PostPosted: Mon Feb 16, 2004 5:32 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Hi nu1,

The technique you are using will mean you have to query and insert the xml tag/attribute names into the string yourself. And effectively build up the XML string you want from the values in the tree. As you rightly say a bit complicated especialy if you don't know in advance what attributes the element contains.

What version of integrator are you using ?

If you are using v5 then there is a neat trick you can try the following;

You can serialize the bit of the tree (ie your input element) you wish to insert into the output attribute value into a BLOB or BITSTREAM element, using the ASBITSTREAM ESQL function.
Then you insert the result into your output attribute casting it as a string.

This should give you what you want, but I think it's only supported on v5.
See the help topic entitled "Handling large XML messages" for an example.


If you are using v2.1 you may be able to do the same thing usng the BITSTREAM function. Not sure I havn't tried this. But it is worth a look.
Back to top
View user's profile Send private message
Meow
PostPosted: Mon Feb 16, 2004 8:28 am    Post subject: Reply with quote

Voyager

Joined: 25 Jun 2003
Posts: 95

I am not able to use the ASBITSTREAM function when i have multiple elements at the same leve.

we cant use :

ASBITSTREAM(InputRoot.XML.parent.child1); -- as it has multiple child elements at the same leve.

ASBITSTREAM(InputRoot.XML.parent) for the same above reason.

Please let me know if the way i am trying to use ASBITSTREAM function is wrong.

I am novice to these functions of ESQL.

Please let me know.

Thanks,
Back to top
View user's profile Send private message
wooda
PostPosted: Tue Feb 17, 2004 4:12 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Meow -

How you tried using ASBITSTREAM on a single instance of your child element.

eg.

ASBITSTREAM(InputRoot.XML.parent.child1[1]);

this should be valid.

You can see how you might then iterate through all instances of the child using ASBITSTREAM on each.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » assign the i/p xml msg to an attribute of o/p xml msg
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.