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 » mapping name-value pairs

Post new topic  Reply to topic Goto page 1, 2  Next
 mapping name-value pairs « View previous topic :: View next topic » 
Author Message
madi
PostPosted: Tue Jan 17, 2006 2:17 pm    Post subject: mapping name-value pairs Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Hi all

I need to transform a valid xml tree structured document into a name value pair xml document and vice versa.

What is the best approach to do it?

THanks
madi


Last edited by madi on Wed Jan 18, 2006 7:57 am; edited 1 time in total
Back to top
View user's profile Send private message
SpitFire
PostPosted: Wed Jan 18, 2006 12:11 am    Post subject: Samples? Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

Hi Madi,
I don't seem to have understood your requirement; hence, can you post some sample input and output messages?
_________________
...: 5|71+ph1|23 :...
Back to top
View user's profile Send private message
madi
PostPosted: Wed Jan 18, 2006 6:46 am    Post subject: sample mesgs Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Hi

Thanks for the reply.

Here are the sample msgs.

Input/Output:

<Some headers>
<Item name="NUMBER" status="ADD"><AttrValue Value="10217180"/></Item>
<Item name="BRAND" status="ADD"><AttrValue value="Red"/></Item>
...
...
</Some Headers>

Output/Input:

<SProduct>
<Product>
<ProdID>PRODID-1</ProductID>
<U>PRODID-1-U</U>
<ActiveE>ACTIVE</ActiveE>
...
...
</Product>
<SProduct>

Can I use a mapping node?

Thanks
madi
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Jan 19, 2006 8:17 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi madi,

Even from your messages we cannot understand what u want to map with what

You can map any two message sets you want, the mapping of attribute to a simple tag or tag to attribute will not be a problem....

Regards.
Back to top
View user's profile Send private message Send e-mail
SpitFire
PostPosted: Thu Jan 19, 2006 11:35 pm    Post subject: Detailed mappings Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

Hi Madi,
I agree with elvis_gn and I would like you to tell us the exact mappings being done here between the input and output. Only with that can we understand what the problem you are facing.
However, as elvis says if you are worried about mapping tag and attribute names, then that shouldn't be a problem at all. One of the IBM manuals that focusses on 'MessageFlows' has sections on ESQL, and there I have seen examples of mappings between tags and attributes. Refer those if that is your requirement.
_________________
...: 5|71+ph1|23 :...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 20, 2006 4:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Madi, are you asking about the following type of transformation
IN
<DataElement name="XYZ" value="123"/>
OUT
<XYZ>123</XYZ>

?
_________________
I am *not* the model of the modern major general.


Last edited by jefflowrey on Fri Jan 20, 2006 8:00 am; edited 1 time in total
Back to top
View user's profile Send private message
SpitFire
PostPosted: Fri Jan 20, 2006 5:26 am    Post subject: Transformation Unclear Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

Hi,
I was just asking what exactly Madi wants to know. And if what Madi was referring to, was simple tag to Attibute and viceversa conversions, then I said it could be found in the manuals, as far as I remember.
_________________
...: 5|71+ph1|23 :...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 20, 2006 7:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Oooh.

Sorry, I got confused about how I was addressing.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
madi
PostPosted: Fri Jan 20, 2006 9:00 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Thanks for the replies guys, iwas busy all day and couldnt get to them.

So anyway, I think I know how to do attribute to tag conversions which is pretty simple.

If i want to map SomeTags.ItemAttr.(XML Attribute)BRAND_NAME in this message

<SomeTags>
<ItemAttr name="ITEM_NUMBER" status="ADD"><AttrValue value="10217180"/></ItemAttr>
<ItemAttr name="BRAND_NAME" status="ADD"><AttrValue value="Mossimo Red"/></ItemAttr>
<ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>
...
... (100s of them)
...
</SometTags>


to Tansaction.Products.Product.Sales in this message

<Transaction>
<MerchantID>com</MerchantID>
<UserID>txml</UserID>
<Password>txml01</Password>
<TransactionNumber>-inbound-</TransactionNumber>
<Type>BatchProduct</Type>
<Products>
<Product>
<ProductID>PRODI</ProductID>
<UPC>PRODID</UPC>
<Active>ACTIVE</Active>
<FirstUsedDate>2005.12.20 16:08:27 CST</FirstUsedDate>
<Sales>EA</Sales>
<Product>
<Products>
<Transaction>

I can use the compute node and check for each ItemAttr Attribute and then map it which would be really ugly.

So I want to know the procedure to do it using mapping node or may be not the procedure but just want to know if it is possible.

At this point my assumption is that the name value pairs may not be in the same order and also all of them may not be present.

Hope this gives a better understanding of the topic.

Thanks
madi
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 20, 2006 10:36 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your input doesn't match your output in any meaningful way to any of your readers.

Could you please show some example messages that have the same fields or at least the same DATA in both the input and the output?

Do you, for example, want to change

IN:
<ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>

To
OUT:
<SHIPPING><ADD>all_states_apo_prot</ADD></SHIPPING>
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
madi
PostPosted: Fri Jan 20, 2006 1:43 pm    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Sorry for not being able to convey properly. im trying my best.

I mean i have the name value pairs and and an output schema that i need to map these name value pairs to.

Need to map <ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>
in the message


<SomeTags>
<ItemAttr name="ITEM_NUMBER" status="ADD"><AttrValue value="10217180"/></ItemAttr>
<ItemAttr name="BRAND_NAME" status="ADD"><AttrValue value="Mossimo Red"/></ItemAttr>
<ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>
...
... (100s of them)
...
</SometTags>

to <Transaction><Products><Product><SHIPPING><ADD>all_states_apo_prot</ADD></SHIPPING></Product></Products></Transaction> in the message


<Transaction>
<MerchantID>com</MerchantID>
<UserID>txml</UserID>
<Password>txml01</Password>
<TransactionNumber>-inbound-</TransactionNumber>
<Type>BatchProduct</Type>
<Products>
<Product>
<SHIPPING><ADD>all_states_apo_prot</ADD></SHIPPING>
<UPC>PRODID</UPC>
</Product>
</Products>
</Transaction>

Hope im clear this time.

thanks
madi
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Jan 20, 2006 8:36 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi madi,

We have two doubts:
1. Are u using message sets for the input and output message ?
2. In the output you have the field SHIPPING and ADD, are you creating those tags in output by picking the value that appears in the input....

If you are doing the 2nd then I suggest you use a compute node itself.

If you are NOT doing 2 AND doing 1, then you can do what you want to do in a mapping node, i.e if you are mapping the field in red to the ALREADY AVAILABLE field in blue.

Quote:
<ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>

<Product>
<SHIPPING><ADD>all_states_apo_prot</ADD></SHIPPING>
<UPC>PRODID</UPC>
</Product>


Note: If you want to check the value of something else like if name="SHIPPING" and then populate the "value" to "ADD"....that also is possible.

Regards.
Back to top
View user's profile Send private message Send e-mail
madi
PostPosted: Sat Jan 21, 2006 10:26 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Hi elvis

First of all, the input and output fields exist and i am not creating the fields.

Secondly, i have to check the name SHIPPING and then populate the corresponding value in the output msg.

Did you say that this was possible in mapping node. Is there a link I can refer to, for learning how to do that?

Thanks
madi
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Jan 24, 2006 2:05 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

madi wrote:
First of all, the input and output fields exist and i am not creating the fields.

I hope you meant that the input and output message definitions exist

In the mapping node,

You will find the source and Target, right click and Add Message Mapping Input/Output.

In your input message do u have all the ItemAttr's(100s of them)
Quote:
<SomeTags>
<ItemAttr name="ITEM_NUMBER" status="ADD"><AttrValue value="10217180"/></ItemAttr>
<ItemAttr name="BRAND_NAME" status="ADD"><AttrValue value="Mossimo Red"/></ItemAttr>
<ItemAttr name="SHIPPING" status="ADD"><AttrValue value="all_states_apo_prot"/></ItemAttr>
...
... (100s of them)
...
</SometTags>


If the same are available in the output message also, then you just have to do a drag and drop, from source to target.

THIS is doable, if you dont have the message sets, use the comput node itself.

Regards.
Back to top
View user's profile Send private message Send e-mail
madi
PostPosted: Tue Jan 24, 2006 6:23 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

Hi Elvis

We will have all of the ItemAttrs in the input xml but if we are dragging and dropping the mappings, does the order become important?

I mean do the name value pairs have to be in the same order everytime because we are not checking the name and then doing the mapping.

Thanks
madi
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » mapping name-value pairs
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.