Database Reference
In-Depth Information
.NET objects. Although XmlSerializer is not the fastest way to process an XML
document in .NET, the strongly typed classes allow for code that is straightforward and
easy to maintain. This approach is a recommended alternative to the XML Source
when you're working with complex XML documents that can easily fit into memory
(for example, smaller than 100MB).
The second pattern uses a combination of LINQ to XML and the XmlReader
class to process XML documents in a streaming manner. This approach is more sensit-
ive to changes to the XML format; it may be harder to maintain, but it will output
scripts that use the XmlSerializer class. This pattern is recommended when you
are processing very large XML documents or when performance is critical.
Configuring the Script Component
The script components in both patterns are configured the same way, but they will con-
tain different code. Both will use a file connection manager to locate the source XML
file at runtime, and both will define the same set of output columns. Use the following
steps to configure your script component:
1. Add a file connection manager to your package.
2. Set Usage Type to Existing File and set the path to our XML source
file as shown in Figure 9-8 .
Figure 9-8 . Configure the File Connection Manager editor
3. Add a data flow to your package, and drag a Script Component trans-
form from the toolbox.
 
 
Search WWH ::




Custom Search