Setting the XSD File Path of an XML Data Source from a Variable
This snippet shows how to set the file path of a XML Schema that is set from a package variable. Notice that two file connections are declared under the Biml root node. One for the XML schema and one for the XML file. The XSD file path is set in the Connections node inside the Package node, by setting the file connections ConnectionString property with an expression.
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<FileConnection Name="XmlFile" FilePath="C:\test\XmlFile.xml" RelativePath="true" />
<FileConnection Name="XmlXsd" FilePath="C:\test\XmlXsd.Xsd" RelativePath="true" />
</Connections>
<Packages>
<Package Name="Package1" ConstraintMode="Parallel">
<Variables>
<Variable Name="SchemaFolder" DataType="String">C:\Schemas\</Variable>
</Variables>
<Tasks>
<Dataflow Name="DataflowTask1">
<Transformations>
<XmlSource Name="XMLSource1">
<XmlSchemaFileInput ConnectionName="XmlXsd" />
<FileInput ConnectionName="XmlFile" />
</XmlSource>
</Transformations>
</Dataflow>
</Tasks>
<Connections>
<Connection ConnectionName="XmlXsd">
<Expressions>
<Expression PropertyName="XmlXsd.ConnectionString"> @[User::SchemaFolder] + "GetDTSColumns.xsd"</Expression>
</Expressions>
</Connection>
</Connections>
</Package>
</Packages>
</Biml>