Database Reference
In-Depth Information
single output with the XML Source component, removing the need to join outputs later
on in the data flow.
Listing 9-5 . Simplified XML Document
<?xml version="1.0" encoding="utf-8"?>
<Customers>
<Customer>
<Key>11000</Key>
<FirstName>Jon</FirstName>
<LastName>Yang</LastName>
<BirthDate>1966-04-08</BirthDate>
<Gender>M</Gender>
<YearlyIncome>90000</YearlyIncome>
</Customer>
<Customer>
<Key>11001</Key>
<FirstName>Eugene</FirstName>
<LastName>Huang</LastName>
<BirthDate>1965-05-14</BirthDate>
<Gender>M</Gender>
<YearlyIncome>60000</YearlyIncome>
</Customer>
</Customers>
Using a Script Component
An alternatve to processing an XML document with the XML Source is to use a script
component. This pattern requires some custom coding, but it gives you full control
over the way the data is output. The .NET Framework provides a number of ways to
parse and load an XML document, each with their own strengths and performance
characteristics. This section describes two separate patterns for processing XML docu-
ments with a script component.
The first pattern uses the XML Schema Definition Tool ( Xsd.exe ) to generate a
set of .NET classes that can be used by an SSIS script component. It uses the Xm-
lSerializer class to convert the source XML document into a set of easy-to-use
 
Search WWH ::




Custom Search