BizTalk Server General - Mapper - Transforming flat file layout to parent/child hierarchy

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2005 > Mapper - Transforming flat file layout to parent/child hierarchy





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 Mapper - Transforming flat file layout to parent/child hierarchy
Nikki

2005-06-23, 5:55 pm

Hi,

Can anyone tell me how to transform a flat file with the following format to
a hierarchical parent/child model; using the example below, ID = unique
record identifier, Parent_ID = Record_N ID the current record is a child of.
If ID and parent_ID are the same, that record is a parent; otherwise that
record is a child:

Input:
Record_1: ID,parent_ID,data....
Record_2: ID,parent_ID,data....
Marvin Smit

2005-06-24, 7:50 am

Hi,

this sounds like a 2 phase scenario. In the pipeline you'll have the
FFDasm rip appart the flat file and turn it into a single large XML
document. Then you can use a map to transform the 'flatfile-xml' into
the hierarchical structure you require.

Hope this helps,

Marvin Smit

On Thu, 23 Jun 2005 08:42:05 -0700, "Nikki"
<Nikki@discussions.microsoft.com> wrote:

>Hi,
>
>Can anyone tell me how to transform a flat file with the following format to
>a hierarchical parent/child model; using the example below, ID = unique
>record identifier, Parent_ID = Record_N ID the current record is a child of.
>If ID and parent_ID are the same, that record is a parent; otherwise that
>record is a child:
>
>Input:
> Record_1: ID,parent_ID,data....
> Record_2: ID,parent_ID,data....
> .
> .
> Record_N: ID,parent_ID,data....
>
>Output:
> <Parent>
> <child></child>
> </parent>
>
>All responses are greatly appreciated!


Nikki

2005-06-24, 7:50 am

Marvin,

thanks for the response; however, I have already done the first part. the
challenge I'm having is figuring out how to use the map to transform the
input to my desired output:

INPUT:
<root>
<record><id>1</id> <parent_id>1</parent_id></record>
<record><id>2</id><parent_id>1</parent_id></record>
<record><id>3</id><parent_id>1</parent_id></record>
</root>

OUTPUT:
<root>
<parent>
<id>1</id>
<child>
<child1 id="2"</child1>
<child2 id="3"</child2>
</child>
</parent>
</root>

Please Help!!

"Nikki" wrote:

> Hi,
>
> Can anyone tell me how to transform a flat file with the following format to
> a hierarchical parent/child model; using the example below, ID = unique
> record identifier, Parent_ID = Record_N ID the current record is a child of.
> If ID and parent_ID are the same, that record is a parent; otherwise that
> record is a child:
>
> Input:
> Record_1: ID,parent_ID,data....
> Record_2: ID,parent_ID,data....
> .
> .
> Record_N: ID,parent_ID,data....
>
> Output:
> <Parent>
> <child></child>
> </parent>
>
> All responses are greatly appreciated!

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com