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 » xml to xml mapping

Post new topic  Reply to topic
 xml to xml mapping « View previous topic :: View next topic » 
Author Message
sanket
PostPosted: Tue Oct 17, 2006 3:04 am    Post subject: xml to xml mapping Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

Hi,

my flow

mqinput -> mapping -> mqoutput

I want to map my input
like
<DataElements>
<plant>123</plant>
<mat>xyz</mat>
</dataElements>

to output like
<DataElements plant='123' mat='xyz'></DataElements>

How to achive this using mapping node?

Thanks,
Sanket
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 17, 2006 3:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

By using the appropriate properties of your message model.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sanket
PostPosted: Tue Oct 17, 2006 3:37 am    Post subject: xml to xml mapping Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

thanks jeff,

Can you tell us which properties and how?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 17, 2006 3:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What's the difference between the two messages?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sanket
PostPosted: Tue Oct 17, 2006 3:45 am    Post subject: xml to xml mapping Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

we want output as attribute where as my input is elements.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 17, 2006 4:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So, which property of the MRM-XML controls how a field in the logical tree is output?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Oct 17, 2006 4:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You have two options:
1. Create two message definitions in your message set. One of them defines the fields as elements. The other defines them as attributes. Use the mapping node to map the first onto the second.
2. Define a single message definition, but add two XML physical formats to your message set. In the first, set the XML Render to 'Element'. In the second, set it to 'Attribute'.

1. is the recommended approach these days.
Back to top
View user's profile Send private message
sanket
PostPosted: Wed Oct 18, 2006 1:18 am    Post subject: Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

I tried option 1. but still output is as element.

what am i missing?....
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Oct 18, 2006 2:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Is the 'Runtime Parser' property of your message set the same as the 'Domain' property of your input node? You should set both of these to 'XMLNSC' unless you need really need MRM features (e.g. validation) for your message flow.
Back to top
View user's profile Send private message
sanket
PostPosted: Wed Oct 18, 2006 3:26 am    Post subject: Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

both are set to 'MRM'...

I think i have not done a good job while creating message set definition.

can you send me some example that have mapped elements to attributes ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 18, 2006 3:31 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Create a basic XSD for your input message. The one that the WMBT will create for you from any XML document is fine for these purposes.

Import this XSD twice into new message files. Leave one alone. Change the Render property on the other one for the elements that you want to be attributes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sasmita10
PostPosted: Fri Oct 20, 2006 12:23 pm    Post subject: Simple Solution Reply with quote

Novice

Joined: 23 Feb 2005
Posts: 24
Location: Danbury, CT

Set OutputRoot.XML.DataElements.(XML.attr)Plant = InputRoot.XML.DataElements.Plant;

Set OutputRoot.XML.DataElements.(XML.attr)Mat = InputRoot.XML.DataElements.Mat;

-Sasmita
_________________
WMQ and WMQI specialist
(IBM Certified Web Sphere MQSeries 6.0 System Administrator )
(IBM Certified Web Sphere Message Broker 6.1 System Administrator )
Back to top
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Fri Oct 20, 2006 1:23 pm    Post subject: Re: Simple Solution Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

sasmita10 wrote:
Set OutputRoot.XML.DataElements.(XML.attr)Plant = InputRoot.XML.DataElements.Plant;

Set OutputRoot.XML.DataElements.(XML.attr)Mat = InputRoot.XML.DataElements.Mat;

-Sasmita


A) How is sanket supposed to code that in the mapping node?

B) Please don't use the XML parser. It's deprecated. Use XMLNS or XMLNSC.

The equivalent to your code would be
Code:
Set OutputRoot.XMLNSC.DataElements.(XMLNSC.Attribute)Plant = InputRoot.XMLNSC.DataElements.Plant

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sanket
PostPosted: Wed Oct 25, 2006 2:14 am    Post subject: Reply with quote

Newbie

Joined: 02 Jun 2006
Posts: 9
Location: pune

Hi guys,

Its resolved,

Just to share some information....

http://www.redbooks.ibm.com/abstracts/sg247137.html

this is the pdf which gave me some basic idea about the mapping of elements to attributes.

Thanks to all helper....
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 » xml to xml mapping
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.