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 » esql to transform xml

Post new topic  Reply to topic
 esql to transform xml « View previous topic :: View next topic » 
Author Message
beth_carlin
PostPosted: Wed Jan 18, 2012 5:41 pm    Post subject: esql to transform xml Reply with quote

Acolyte

Joined: 08 Jun 2004
Posts: 64

Hi Guru


I am trying to solve this problem. I appreciate any suggestion


my input xml:


<testinput>
<SetLevelProperties>
<Name name="Name">aa</Name>
<Description name="Description">bb</Description>
</SetLevelProperties>
</testinput>


I'd like the output to be like this (w/o the name='Name')


<testoutput>
<SetLevelProperties>
<TopName>aa</TopName>
<TopDescription>bb</TopDescription>
</SetLevelProperties>
</testoutput>


and this is my code:

SET OutputRoot.XML.testoutput.SetLevelProperties.TopName =
InputBody.testinput.SetLevelProperties.Name ;


SET OutputRoot.XML.testoutput.SetLevelProperties.TopDescription =
InputBody.testinput.SetLevelProperties.Description ;


but it comes out to be like this:

<testoutput>
<SetLevelProperties>
<TopName name="Name">aa</TopName>
<TopDescription name="Description">bb</TopDescription>
</SetLevelProperties>
</testoutput>


How can i rid the name="Name" in the output? Look thru the entire esql
manual and not find it yet.

Thanks again

Beth
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jan 18, 2012 8:12 pm    Post subject: Re: esql to transform xml Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

beth_carlin wrote:

How can i rid the name="Name" in the output? Look thru the entire esql
manual and not find it yet.
Beth


FIELDVALUE should help you out. Check this link,
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05560_.htm
Back to top
View user's profile Send private message Send e-mail
cociu_2012
PostPosted: Thu Jan 19, 2012 12:12 am    Post subject: Re: esql to transform xml Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

beth_carlin wrote:
Hi Guru


and this is my code:

SET OutputRoot.XML.testoutput.SetLevelProperties.TopName =
InputBody.testinput.SetLevelProperties.Name ;


SET OutputRoot.XML.testoutput.SetLevelProperties.TopDescription =
InputBody.testinput.SetLevelProperties.Description ;

How can i rid the name="Name" in the output? Look thru the entire esql
manual and not find it yet.

Thanks again

Beth


What version of broker are you using. Isn't XML parser deprecated?

Solution is really simple:

Code:
SET OutputRoot.XMLNSC.testoutput.SetLevelProperties.TopName =  InputBody.testinput.SetLevelProperties.Name;
SET OutputRoot.XMLNSC.testoutput.SetLevelProperties.TopDescription =  InputBody.testinput.SetLevelProperties.Description;


This will output your desire XML.

To map Attributes you'll have to code:
Code:
SET OutputRoot.XMLNSC.testoutput.SetLevelProperties.TopName(XMLNSC.Attribute)name = InputBody.testinput.SetLevelProperties.Name.name;


Last edited by cociu_2012 on Thu Jan 19, 2012 4:23 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jan 19, 2012 3:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You must change your message flow to use the XMLNSC domain. The XML domain is deprecated in *all* supported versions of WMB.

Please take the time to use [c o d e] tags when posting XML. It makes it much easier for us to understand your problem. You can use the edit button now if you like

If you just want to remove an attribute from the output message, then this is the easiest way to do it:
Code:
SET OutputRoot.XMLNSC.testoutput = InputRoot.XMLNSC.testinput;
SET OutputRoot.XMLNSC.testOutput.(XMLNSC.Attribute)name = NULL;
Back to top
View user's profile Send private message
cociu_2012
PostPosted: Thu Jan 19, 2012 4:20 am    Post subject: Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

kimbert wrote:
Code:
SET OutputRoot.XMLNSC.testoutput = InputRoot.XMLNSC.testinput;
SET OutputRoot.XMLNSC.testOutput.(XMLNSC.Attribute)name = NULL;


He has a different structure at Output. So the code you've posted will not solve the problem. He just has to map element by element.
Attributes will not map, as it needs special treatment.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jan 19, 2012 4:39 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

True - I missed the addition of the 'Top' prefix to the tag names.
Back to top
View user's profile Send private message
beth_carlin
PostPosted: Thu Jan 19, 2012 1:07 pm    Post subject: Re: esql to transform xml Reply with quote

Acolyte

Joined: 08 Jun 2004
Posts: 64

kash3338 wrote:
beth_carlin wrote:

How can i rid the name="Name" in the output? Look thru the entire esql
manual and not find it yet.
Beth


FIELDVALUE should help you out. Check this link,
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05560_.htm



----------------------------------------

THANK YOU Guru, the FIELDVALUE works great and THANK to ALL of YOU. I am using wmbv7
Back to top
View user's profile Send private message
cociu_2012
PostPosted: Thu Jan 19, 2012 11:44 pm    Post subject: Re: esql to transform xml Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

beth_carlin wrote:

THANK YOU Guru, the FIELDVALUE works great and THANK to ALL of YOU. I am using wmbv7


I'm glad that it worked for you, but you should really take into consideration that using a DEPRECATED parser is not a good idea.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jan 20, 2012 2:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
using a DEPRECATED parser is not a good idea.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Fri Jan 20, 2012 4:31 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

kimbert wrote:
Quote:
using a DEPRECATED parser is not a good idea.


SET OutputRoot.XML.testoutput.SetLevelProperties.TopName =
InputBody.testinput.SetLevelProperties.Name ;

SET OutputRoot.XML.testoutput.SetLevelProperties.TopDescription =
InputBody.testinput.SetLevelProperties.Description ;

--> you should use XMLNSC instead.
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
cociu_2012
PostPosted: Fri Jan 20, 2012 4:42 am    Post subject: Reply with quote

Acolyte

Joined: 06 Jan 2012
Posts: 72

mqsiuser wrote:


Code:

SET OutputRoot.[b]XML[/b].testoutput.SetLevelProperties.TopName =
InputBody.testinput.SetLevelProperties.Name ;

SET OutputRoot.[b]XML[/b].testoutput.SetLevelProperties.TopDescription =
InputBody.testinput.SetLevelProperties.Description ;


--> you should use XMLNSC instead.


your post is a little bit misleading. Setting XMLNSC just on mapping is not enough. He has to use this parser when first parsing occurs(Input node, ESQL parsing, and so on). If you're also using an MS, verify if you have XMLNSC checked.[/code]
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 » esql to transform xml
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.