Re: BizTalk Mapper BUG ?



Thanks for the reply.

i know i can't achieve this the easy way, but shouldn't i ? as i see it, the
mapper component is doing lazy work "if there's a default value then write
its node tree to the output regardless his parent is optional with no default
value".i believe the mapper component is trying to simplify the actual xslt,
but in this case, is not doing a good job, in fact i think it's quite a BUG,
or am i missing something obvious ?

i had to remove the default value from the attribute to get right results,
but since i'm working with an imported schema from a partner, is this the
right way to do things ?

i tried other ways as you suggested (check existence, value mapping, etc )
but the outcome is always the same, i get the undeseried output.

TIA


"Yossi Dahan" wrote:

> I understand what you're tying to do now, but I'm afraid I still don't think
> you can achieve this simply be specifying a default value.
> Specifying a default value is essentially like linking the attribute - you
> instruct the map to write a value and it is kindly doing what you've asked
> for.
>
> You will have to have a bit more complex mapping, checking the existence of
> the source element and using the result of this check with a value mapping
> functoid to link a constant value (assuming, from your choice of using a
> default value that this is in fact a constant) to the attribute
>
> Good luck
>
> Yossi Dahan
>
>
> "Luis Azedo" <LuisAzedo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:118685E1-15BD-4377-BB49-E8C00F83C0FC@xxxxxxxxxxxxxxxx
> > Hi Yossi, thanks for the reply.
> >
> > what i would expect is that the mapper would make sure that the field is
> > populated, but if the parent node isn't created because i didn't make any
> > to
> > it, and its minOccurs value = 0, then default value should be ignored.
> >
> > let me try to explain with an example
> >
> > Source
> >
> > <a>
> > <b>xxxxxxx</b>
> > <c>
> > <c1>wwwwwww</c1>
> > </c>
> > </a>
> >
> > Destination
> >
> > <x>
> > <y>xxxxxxx<y/>
> > <z>wwwwwww</z>
> > <w myatribute="defaultvalue"></w>
> > </x>
> >
> > since i didn't make a link between any field/record from source to element
> > <w> in destination, and since element <w> as minocccurs = 0, then element
> > w
> > shouldn't appear in the output.
> >
> > the rule should be something like : ensure that the destination
> > fields/records appear if they have a default value and is parent node is
> > populated by a link or it also has a default value.
> >
> >
> > does this make any sense ?
> >
> > TIA
> >
> >
> >
> >
> >
> > "Yossi Dahan" wrote:
> >
> >> Luis
> >>
> >> I believe this is the purpose of the default value property - to make
> >> sure a
> >> field is being created and populated with the value specified.
> >>
> >> What behaviour did you expect?
> >>
> >> Yossi Dahan
> >>
> >>
> >> "Luis Azedo" <LuisAzedo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:560C7ACE-5CB4-4100-B261-11FDE85851FE@xxxxxxxxxxxxxxxx
> >> > Hi All,
> >> >
> >> > i'm having the following problem with mapper.
> >> >
> >> > my destination schema has some optional attributes with default values
> >> > on
> >> > some elements. these elements have minoccurs=0, but they keep apearing
> >> > on
> >> > my
> >> > output result (attributes with default values) when i don't have any
> >> > links
> >> > to
> >> > them. if i remove the default values from the attributes everything is
> >> > well.
> >> >
> >> >
> >>
> >>
> >>
>
>
>
.


Loading