Yesudass Moses
Yesudass Moses

Reputation: 1859

SSIS: Getting parent row field in sub-row output in XML Source

I have an SSIS Package which reads XML file using XML Source Component. This XML File has two outputs. One is for "Invoice" and other is for "InvoiceDetail" The structure of the XML File is like this.

    <my:myFields>
    <my:group1>
    <my:Invoice>
        <my:field1>1</my:field1>
        <my:field2>2014-11-11</my:field2>
        <my:field3>33370</my:field3>
        <my:Group2>
            <my:InvoiceDetail>

                <my:Sub6 xsi:nil="true">100</my:Sub6>
                <my:Sub7 xsi:nil="true">Charges</my:Sub7>
                <my:Sub8>140</my:Sub8>
                <my:Sub9 xsi:nil="true">78</my:Sub9>
                <my:Sub10 xsi:nil="true">0</my:Sub10>
                <my:Sub12>0</my:Sub12>
            </my:InvoiceDetail>
        </my:Group2>
        <my:field18></my:field18>
    </my:Invoice>
    </my:group1>
    </my:myFields>

I can get all fields of Invoice and InvoiceDetail in seperate outputs. But, I cannot join these rows since InvoiceDetail doesn't have the ID (field1) which links to the Invoice. Is there any idea to get the InvoiceID field also with the InvoiceDetail output ?

Upvotes: 0

Views: 180

Answers (1)

Ezhil Arasan
Ezhil Arasan

Reputation: 478

It Can be possible by XSLT transformation.

Create XSLT schema then give xml,flat file parameter to C# script xml transformation

Upvotes: 1

Related Questions