|
Home > Archive > BizTalk Server Orchestration > September 2005 > Filtering in Map
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]
|
|
| Ben Jiang 2005-09-07, 8:50 pm |
| Hi,
I have a map problem for help:
Source:
<MyRoot>
<Line>00~item1</Line>
<Line>00~Item2</Line>
<Line>01~Item3</Line>
<Line>02~Item4</Line>
<Line>01~Item5</Line>
<Line>00~Item6</Line>
.....
</MyRoot>
Where each Line text always starting with either "00", "01" or "02" and
following the description of the records, eg. Item1, Item2, ....
Want to Map to the following using Mapper in BT2004:
<MyRecord>
<Record00>
<Record Type="00" Value="Item1" />
<Record Type="00" Value="Item2" />
....
</Record00>
<Record01>
<Record Type="01" Value="Itemn" />
<Record Type="01" Value="Itemm" />
....
</Record01>
<Record02>
<Record Type="02" Value="Itemi" />
<Record Type="02" Value="Itemj" />
....
</Record02>
</MyRecord>
The best I can get when I use the mapper is as follows:
<MyRecord>
<Record00>
<Record Type="00" Value="Item1" />
<Record Type="00" Value="Item2" />
<Record />
<Record />
...
</Record00>
<Record01>
<Record Type="01" Value="Itemn" />
<Record Type="01" Value="Itemm" />
<Record />
<Record />
...
</Record01>
<Record02>
<Record Type="02" Value="Itemi" />
<Record Type="02" Value="Itemj" />
<Record />
<Record />
...
</Record02>
</MyRecord>
Note that I get all those empty records.
Any help will be highly appreciated.
Ben Jiang
| |
| Selvan 2005-09-09, 7:49 am |
| Ben,
Please post the screenshot of your map and functoid properties to my my
mail id its tamilselvan(at)gmail(dot)com. Hope it can be solved..
Cheers
Tamilselvan Subramanian,
Integration Analyst,
IBM Global Services India Ltd.
"Ben Jiang" wrote:
> Hi,
> I have a map problem for help:
> Source:
> <MyRoot>
> <Line>00~item1</Line>
> <Line>00~Item2</Line>
> <Line>01~Item3</Line>
> <Line>02~Item4</Line>
> <Line>01~Item5</Line>
> <Line>00~Item6</Line>
> ....
> </MyRoot>
> Where each Line text always starting with either "00", "01" or "02" and
> following the description of the records, eg. Item1, Item2, ....
>
> Want to Map to the following using Mapper in BT2004:
> <MyRecord>
> <Record00>
> <Record Type="00" Value="Item1" />
> <Record Type="00" Value="Item2" />
> ....
> </Record00>
> <Record01>
> <Record Type="01" Value="Itemn" />
> <Record Type="01" Value="Itemm" />
> ....
> </Record01>
> <Record02>
> <Record Type="02" Value="Itemi" />
> <Record Type="02" Value="Itemj" />
> ....
> </Record02>
> </MyRecord>
>
> The best I can get when I use the mapper is as follows:
> <MyRecord>
> <Record00>
> <Record Type="00" Value="Item1" />
> <Record Type="00" Value="Item2" />
> <Record />
> <Record />
> ...
> </Record00>
> <Record01>
> <Record Type="01" Value="Itemn" />
> <Record Type="01" Value="Itemm" />
> <Record />
> <Record />
> ...
> </Record01>
> <Record02>
> <Record Type="02" Value="Itemi" />
> <Record Type="02" Value="Itemj" />
> <Record />
> <Record />
> ...
> </Record02>
> </MyRecord>
>
> Note that I get all those empty records.
>
> Any help will be highly appreciated.
>
> Ben Jiang
>
| |
| Matt Milner 2005-09-09, 5:52 pm |
| You should be able to use the value mapping (Flattening) functoid to achieve
what you want. You'll need to use the string left and string right
functoids to extract values for comparison and mapping, but otherwise it
should map over fine.
Matt
"Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
news:A9BF99C1-5442-4D65-AE80-91666435BDEA@microsoft.com...
> Hi,
> I have a map problem for help:
> Source:
> <MyRoot>
> <Line>00~item1</Line>
> <Line>00~Item2</Line>
> <Line>01~Item3</Line>
> <Line>02~Item4</Line>
> <Line>01~Item5</Line>
> <Line>00~Item6</Line>
> ....
> </MyRoot>
> Where each Line text always starting with either "00", "01" or "02" and
> following the description of the records, eg. Item1, Item2, ....
>
> Want to Map to the following using Mapper in BT2004:
> <MyRecord>
> <Record00>
> <Record Type="00" Value="Item1" />
> <Record Type="00" Value="Item2" />
> ....
> </Record00>
> <Record01>
> <Record Type="01" Value="Itemn" />
> <Record Type="01" Value="Itemm" />
> ....
> </Record01>
> <Record02>
> <Record Type="02" Value="Itemi" />
> <Record Type="02" Value="Itemj" />
> ....
> </Record02>
> </MyRecord>
>
> The best I can get when I use the mapper is as follows:
> <MyRecord>
> <Record00>
> <Record Type="00" Value="Item1" />
> <Record Type="00" Value="Item2" />
> <Record />
> <Record />
> ...
> </Record00>
> <Record01>
> <Record Type="01" Value="Itemn" />
> <Record Type="01" Value="Itemm" />
> <Record />
> <Record />
> ...
> </Record01>
> <Record02>
> <Record Type="02" Value="Itemi" />
> <Record Type="02" Value="Itemj" />
> <Record />
> <Record />
> ...
> </Record02>
> </MyRecord>
>
> Note that I get all those empty records.
>
> Any help will be highly appreciated.
>
> Ben Jiang
>
| |
| Ben Jiang 2005-09-15, 2:49 am |
| Hi Matt,
I think I have done what your suggestion, but I got all those
empty nodes for different record type as indicated in my previous post.
If you can just make a simple test and you can get rid of empty nodes and
post here, I will be very happy to see it and thank for your help.
Cheers
Ben Jiang
"Matt Milner" wrote:
> You should be able to use the value mapping (Flattening) functoid to achieve
> what you want. You'll need to use the string left and string right
> functoids to extract values for comparison and mapping, but otherwise it
> should map over fine.
>
> Matt
>
>
> "Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
> news:A9BF99C1-5442-4D65-AE80-91666435BDEA@microsoft.com...
>
>
>
| |
| Matt Milner 2005-09-25, 2:48 am |
| I've got a sample that will show you how to do this. I must admit there was
an extra step to get it to work right. The value mapping functoid sticks
the xsl:for-each in the wrong spot so you only get one record node for each
type of record. So, I used the scripting functoid to do the output and made
it conditional on the logical functoid to test for the initial two
characters.
Send me an email offline and I can send you the sample project.
Thanks,
Matt
"Ben Jiang" <BenJiang@discussions.microsoft.com> wrote in message
news:FC520032-F72A-4BBD-87FF-7C6B78AC3D6D@microsoft.com...[vbcol=seagreen]
> Hi Matt,
> I think I have done what your suggestion, but I got all those
> empty nodes for different record type as indicated in my previous post.
>
> If you can just make a simple test and you can get rid of empty nodes and
> post here, I will be very happy to see it and thank for your help.
>
> Cheers
> Ben Jiang
>
> "Matt Milner" wrote:
>
|
|
|
|
|