BizTalk Server General - mapping question

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > March 2006 > mapping question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mapping question
MrFez

2006-03-19, 11:59 am

hello, i'm new to biztalk and was wondering how to accomplish map repeating
elements in the source into different places in the destination.

I've got source xml something like:

<main>
<gift>bygender</gift>
<ele>
<childType>boy</childType>
<childToy>truck</childInfo>
<Comment>
<rem>comment1</rem>
</Comment>
</ele>
<ele>
<childType>girl</childType>
<childToy>doll</childToy>
</ele>
<ele>
<childType>notspecified</childType>
<childToy>book</childToy>
<Comment>
<rem>comment2</rem>
</Comment>
</ele>
</main>

and I want to map it to

<result>
<gifts>bygender</gifts>
<boysToy>truck</boysToy>
<boyComments>comment1</boyComments>
<girlsToy>doll<girlsToy>
<girlsComments><girlsComments>
<notspToy>book</notspToy>
<notspComments>comment2<notspComments>
</result>

In my map i use the = to check the value of childType and then I use the
value mapping functoid to map the data to the correct field. The problem I'm
having is that it only seems to look at the first <ele></ele>.

How do I iterate thru all the <ele>?

Any help would be good.

Thanks.
Eric Stott

2006-03-21, 3:09 am

if you drag a line from <ele> record to the <result> record, I am assuming
that the <result> is not the root object, as there can only be one
occurrence of this object, and that <result> is set to be multiple occuring.

Eric
http://stottcreations.com/blog

"MrFez" <MrFez@discussions.microsoft.com> wrote in message
news:CE9F4BA1-4B0B-40BC-8EB7-93756E0F3807@microsoft.com...
> hello, i'm new to biztalk and was wondering how to accomplish map
> repeating
> elements in the source into different places in the destination.
>
> I've got source xml something like:
>
> <main>
> <gift>bygender</gift>
> <ele>
> <childType>boy</childType>
> <childToy>truck</childInfo>
> <Comment>
> <rem>comment1</rem>
> </Comment>
> </ele>
> <ele>
> <childType>girl</childType>
> <childToy>doll</childToy>
> </ele>
> <ele>
> <childType>notspecified</childType>
> <childToy>book</childToy>
> <Comment>
> <rem>comment2</rem>
> </Comment>
> </ele>
> </main>
>
> and I want to map it to
>
> <result>
> <gifts>bygender</gifts>
> <boysToy>truck</boysToy>
> <boyComments>comment1</boyComments>
> <girlsToy>doll<girlsToy>
> <girlsComments><girlsComments>
> <notspToy>book</notspToy>
> <notspComments>comment2<notspComments>
> </result>
>
> In my map i use the = to check the value of childType and then I use the
> value mapping functoid to map the data to the correct field. The problem
> I'm
> having is that it only seems to look at the first <ele></ele>.
>
> How do I iterate thru all the <ele>?
>
> Any help would be good.
>
> Thanks.



MrFez

2006-03-21, 3:10 am

Thanks Eric.

The sample I posted above is a simplifed version of the actual source
schema. There are several sections like <ele> which repeat and the <rem>
also repeats. <main> is also a repeating node (nested under something else),
and they are all unbounded.

I've tried your suggestion and am getting an error along the lines of
"element cannot be empty or contain whitespaces".

I've also tried adding a looping functoid connecting the element <ele> and
the <result> and am getting some things repeating but not others.

Do anyone know if I have to use the iteration + index + looping functoid?
And if so, in what combination?



"Eric Stott" wrote:

> if you drag a line from <ele> record to the <result> record, I am assuming
> that the <result> is not the root object, as there can only be one
> occurrence of this object, and that <result> is set to be multiple occuring.
>
> Eric
> http://stottcreations.com/blog
>
> "MrFez" <MrFez@discussions.microsoft.com> wrote in message
> news:CE9F4BA1-4B0B-40BC-8EB7-93756E0F3807@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com