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.Attribute to XML.Element Mapping issue

Post new topic  Reply to topic
 XML.Attribute to XML.Element Mapping issue « View previous topic :: View next topic » 
Author Message
dev
PostPosted: Mon Jan 06, 2003 9:30 am    Post subject: XML.Attribute to XML.Element Mapping issue Reply with quote

Apprentice

Joined: 11 Oct 2001
Posts: 30

I have an XML to XML mapping where I have to map Incoming XML attribute to Outgoing XML Element.

Incoming XML message is:
<?xml version = "1.0" encoding = "UTF-8"?>
<Input_Root_Tag>
<Child_Tag Identifier = "100" >
</Child_Tag>
</Input_Root_Tag>

Desired Output XML is:

<Output_Root_Tag>
<Out_Child_Tag>
<Out_Identifier>100</Out_Identifier>
</Out_Child_Tag>
</Output_Root_Tag>

1) I tried mapping :
SET OutputRoot.XML.Output_Root_Tag.Out_Child_Tag.Out_Identifier = InputRoot.XML.Input_Root_Tag.Child_Tag.(XML.Attribute)Identifier;

I get output
<Output_Root_Tag>
<Out_Child_Tag Out_Identifier = "100" \>
</Output_Root_Tag>


2) When I tried mapping:

SET OutputRoot.XML.Output_Root_Tag.Out_Child_Tag.(XML.Element)Out_Identifier = InputRoot.XML.Input_Root_Tag.Child_Tag.(XML.Attribute)Identifier;

I get output
<Output_Root_Tag>
<Out_Child_Tag>
<Out_Identifier/>
</Out_Child_Tag>
</Output_Root_Tag>

??
Can anyone tell me what is missing here??

Thanks in advance.
Back to top
View user's profile Send private message
maxis
PostPosted: Tue Jan 07, 2003 11:04 am    Post subject: Reply with quote

Centurion

Joined: 25 Jun 2002
Posts: 144

dev,
in my previous project I ran into similar problem, while mapping XML attribute with an Element. I think error may be due to the XML parsing and trying to assign Element to an attribute.
One of the way to solve it, make use of temp variable to assign the value. It may not be the best ... but works perfect.

Code:

declare X char;

set X = InputRoot.XML.Input_Root_Tag.Child_Tag.(XML.Attribute)Identifier ;
SET OutputRoot.XML.Output_Root_Tag.Out_Child_Tag.Out_Identifier = X;



best of luck

M
Back to top
View user's profile Send private message
dev
PostPosted: Tue Jan 07, 2003 11:07 am    Post subject: Reply with quote

Apprentice

Joined: 11 Oct 2001
Posts: 30

Thanks! It works!
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.Attribute to XML.Element Mapping issue
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.