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 changed to element

Post new topic  Reply to topic
 Xml attribute changed to element « View previous topic :: View next topic » 
Author Message
Omuch
PostPosted: Thu May 31, 2012 1:58 am    Post subject: Xml attribute changed to element Reply with quote

Acolyte

Joined: 23 Mar 2012
Posts: 54

Hi

I'm using Broker 6.1.0.7
Has anyone ever encountered a problem in mapping node that changed an XML attribute to XML element
Should be:
Code:

<Person age="20" >
.
.
.</Person>


What comes:
Code:

<Person>
<age>20</age>
.
.
.
</Person>
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu May 31, 2012 2:07 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

What domain are you using for OutputRoot?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 31, 2012 2:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Did you populate the data into a tree that does not have an XMLNSC parser associated with it before the mapping node?

Does the message definition that the Mapping node is using to create the output message specify that this field must be an attribute?
Back to top
View user's profile Send private message
Omuch
PostPosted: Thu May 31, 2012 5:13 am    Post subject: Reply with quote

Acolyte

Joined: 23 Mar 2012
Posts: 54

mqjeff wrote:
Did you populate the data into a tree that does not have an XMLNSC parser associated with it before the mapping node?


I'm using MRM before and after the mapping node

mqjeff wrote:
Does the message definition that the Mapping node is using to create the output message specify that this field must be an attribute?


Yes, and the value of the attribute is fixed.
I have repeated elements in the tree , the mapping node creates the first as attribute but the second as element.
Code:

<Person age="20">
.
.
</Person>
.
.
<Person>
<age>20<age>
.
.
</Person>
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu May 31, 2012 5:18 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

My best guess : the structure of the output message tree does not match the structure of the message definition. Please set Validation to 'Content and Value' on the Mapping node. If you get a validation error from the MRM parser then I'm right.
Back to top
View user's profile Send private message
Omuch
PostPosted: Sat Jun 02, 2012 12:08 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Mar 2012
Posts: 54

kimbert wrote:
My best guess : the structure of the output message tree does not match the structure of the message definition..


Of course it doesn't match , instend of an attribute I'm getting
a new element that isn't on the message definition .

kimbert wrote:
Please set Validation to 'Content and Value' on the Mapping node. If you get a validation error from the MRM parser then I'm right.


Even if you're right, why it's happening ? and how I should fix it?
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Jun 02, 2012 12:15 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't think your understand what mean when I say 'structure'. I'm talking about the logical structure, not the physical rendering of that structure in an XML document.

I suggest that you try my suggestion anyway. Either you will disprove my theory, or you will confirm it. If the latter then a careful reading of the error message would probably answer your questions.
Back to top
View user's profile Send private message
Omuch
PostPosted: Sat Jun 02, 2012 10:37 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Mar 2012
Posts: 54

kimbert wrote:

I suggest that you try my suggestion anyway. Either you will disprove my theory, or you will confirm it. If the latter then a careful reading of the error message would probably answer your questions.


I tried it, there is no error.
The output of the mapping node is valid, but I still have a new element instead of an attribute.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Jun 03, 2012 12:58 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Omuch wrote:
kimbert wrote:

I suggest that you try my suggestion anyway. Either you will disprove my theory, or you will confirm it. If the latter then a careful reading of the error message would probably answer your questions.


I tried it, there is no error.
The output of the mapping node is valid, but I still have a new element instead of an attribute.


So have you defined it as an attribute in your message set?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Omuch
PostPosted: Mon Jun 04, 2012 11:43 am    Post subject: Reply with quote

Acolyte

Joined: 23 Mar 2012
Posts: 54

fjb_saper wrote:
Omuch wrote:
kimbert wrote:

I suggest that you try my suggestion anyway. Either you will disprove my theory, or you will confirm it. If the latter then a careful reading of the error message would probably answer your questions.


I tried it, there is no error.
The output of the mapping node is valid, but I still have a new element instead of an attribute.


So have you defined it as an attribute in your message set?


Yes, and the value is fixed.
I checked it and really, the structure of the output tree doen't match the structure of the message definition as kimbert sayed,
but for some reason I didn't get an validation error.

Code:

In the message  definition it looks like:
.
.
Person_1  complex type   max occurs: 100
Person_2  complex type   max occurs: 100

And after the mapping :
 Person_1
 Person_2
 Person_1
 Person_2
.
.
.


I think it's because of this Mismatch, but the fact is that the mapping is able to map the whole object in his second instance except his attribute.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jun 04, 2012 11:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'm quite sure it's because you're using MRM to model XML instead of XMLNSC and because you haven't taken efforts to ensure that your sequences are CLOSED rather than OPEN.

In other words, please switch to using XMLNSC.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jun 04, 2012 2:29 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I agree with mqjeff. This is an example of why XMLNSC has been provided as a replacement for MRM XML.
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 changed to element
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.