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 » Anonymous mixed content xml mapping

Post new topic  Reply to topic Goto page 1, 2  Next
 Anonymous mixed content xml mapping « View previous topic :: View next topic » 
Author Message
Fayaz
PostPosted: Wed Aug 17, 2011 8:46 am    Post subject: Anonymous mixed content xml mapping Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

Hi,

I have a DB select output which I am trying to map to a complex xml structure. Problem is I do have a couple of anonymous mixed content fields and it seems to be repeating in the XML structure for multiple rows. My DB output looks as below:

    Col1 Col2 Col3 Col4 Col5
    1 English Title - en 7 Blue - en
    1 French Title -fr 7 Blue - fr
    1 German Title -de 7 Blue - de
    1 English Title -gb 21 Black - en
    1 French Title -fr 21 Black - fr
    1 German Title -de 21 Black - de

and I am trying to map to an xml like:

Code:
<ContentMaster>
  <Entry>
    <Col1>1</Col1>
    <Col3 Col2="English">Title - en</Col3>
    <Col3 Col2="French">Title - fr</Col3>
    <Col3 Col2="German">Title - de</Col3>
    <Entry1>
      <Color Col4="7">
        <Col5 Col2="English">Blue - en</Col5>
        <Col5 Col2="French">Blue - fr</Col5>
        <Col5 Col2="German">Blue - de</Col5>
      </Color>
      <Color Col4="21">
        <Col5 Col2="English">Black - en</Col5>
        <Col5 Col2="French">Black - fr</Col5>
        <Col5 Col2="German">Black - de</Col5>
      </Color>
    </Entry1>
  </Entry>
</ContentMaster>


I have created a schema but it is giving me duplicate results for all the anomymous mixed content values, how can I eliminate this?

Thanks,
Fayaz


Last edited by Fayaz on Wed Aug 17, 2011 11:10 am; edited 1 time in total
Back to top
View user's profile Send private message
kotagiriaashish
PostPosted: Wed Aug 17, 2011 9:16 am    Post subject: Reply with quote

Disciple

Joined: 06 Aug 2011
Posts: 165

How are you mapping?
Back to top
View user's profile Send private message
Fayaz
PostPosted: Wed Aug 17, 2011 9:17 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

By using the message mapping node..
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 17, 2011 9:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So you haven't configured your map to produce the output you desire.

Perhaps you should review how the map is built and see what you can do to adjust it.
Back to top
View user's profile Send private message
Fayaz
PostPosted: Wed Aug 17, 2011 9:27 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

I can't use the occurence feature because that would choose only one value...what other message map functions can I use here to eliminate this?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 17, 2011 9:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The relevant mapping functions or mapping configuration that produces your desired output.

What is your desired output?
Back to top
View user's profile Send private message
Fayaz
PostPosted: Wed Aug 17, 2011 9:36 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

It is this:
Code:
<ContentMaster>
             <Entry>
                 <Col1>1</Col1>
                 <Col3 Col2="English">Title - en</Col3>
                 <Col3 Col2="French">Title - fr</Col3>
                 <Col3 Col2="German">Title - de</Col3>
                 <Entry1>
                     <Color Col4="7">
                          <Col5 Col2="English">Blue - en</Col5>
                          <Col5 Col2="French">Blue - fr</Col5>
                          <Col5 Col2="German">Blue - de</Col5>
                     </Color>
                     <Color Col4="21">
                          <Col5 Col2="English">Black - en</Col5>
                          <Col5 Col2="French">Black - fr</Col5>
                          <Col5 Col2="German">Black - de</Col5>
                      </Color>
                </Entry1>
         </Entry>
</ContentMaster>


Right now I am getting:

Code:
<ContentMaster>
  <Entry>
    <Col1>1</Col1>
    <Col3 Col2="English">Title - en</Col3>
    <Col3 Col2="French">Title - fr</Col3>
    <Col3 Col2="German">Title - de</Col3>
    <Col3 Col2="English">Title - en</Col3>
    <Col3 Col2="French">Title - fr</Col3>
    <Col3 Col2="German">Title - de</Col3>
    <Entry1>
      <Color Col4="7">
        <Col5 Col2="English">Blue - en</Col5>
        <Col5 Col2="French">Blue - fr</Col5>
        <Col5 Col2="German">Blue - de</Col5>
      </Color>
      <Color Col4="21">
        <Col5 Col2="English">Black - en</Col5>
        <Col5 Col2="French">Black - fr</Col5>
        <Col5 Col2="German">Black - de</Col5>
      </Color>
      <Color Col4="7">
        <Col5 Col2="English">Blue - en</Col5>
        <Col5 Col2="French">Blue - fr</Col5>
        <Col5 Col2="German">Blue - de</Col5>
      </Color>
      <Color Col4="21">
        <Col5 Col2="English">Black - en</Col5>
        <Col5 Col2="French">Black - fr</Col5>
        <Col5 Col2="German">Black - de</Col5>
      </Color>
    </Entry1>
  </Entry>
</ContentMaster>


Last edited by Fayaz on Wed Aug 17, 2011 11:09 am; edited 3 times in total
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Aug 17, 2011 9:51 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

[c o d e] tags
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Fayaz
PostPosted: Wed Aug 17, 2011 10:01 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

Lance, what do you mean?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Aug 17, 2011 11:03 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Code Tags.
Makes listing and code samples much more HUMAN readable.

When you add an entry there are a number of options presented above the box where you tyoe your text.

B i U Quote Code List List= Img URL

B = Bold
i = italic
U = Underscore
Quote = Obvious
Code = {see Above}

Etc. etc.

As the Meerkats say, Simples.

So why not go back and edit your posts and then you will see the difference.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Fayaz
PostPosted: Wed Aug 17, 2011 11:11 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

Thanks SM...I have edited my posts....hope it's easier to read now...
Back to top
View user's profile Send private message
Fayaz
PostPosted: Thu Aug 18, 2011 6:41 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

hey guys...any updates on this?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 18, 2011 6:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's a direct consequence of how your map is written.

There doesn't appear to actually be any anonymous mixed content in your output message. Or if there actually is, you've not shown it properly.

You just appear to have mapped things more than once.
Back to top
View user's profile Send private message
Fayaz
PostPosted: Wed Aug 24, 2011 7:07 am    Post subject: Reply with quote

Novice

Joined: 21 Jul 2011
Posts: 18

How do I control the mapping, can't seem to find anything which would help me to get the required resultset..
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 24, 2011 7:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you can't figure out how to do it in Mapping, perhaps you should consider using ESQL, Java, or PHP.

On the other hand, nobody here knows how you've tried to do it via mapping, since you haven't posted any information about your map itself - just what you have as input and what you're trying to get as output.

So maybe if you showed what you have tried, rather than essentially asking us to write the map for you, you might get more information.
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 » Anonymous mixed content 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.