Help > Tasks > XML Parser Task >
SSIS XML Parser Task
PreviousNext

SSIS XML Parser Task can parse XML document from direct SSIS value/file and extract values into multiple SSIS variables using XPath expression language.

Download SSIS PowerPack

Content

Video Tutorial

Coming soon...

Step-By-Step

In this tutorial we will learn how to parse XML value using ZS XML Parser Task.
  1. Firstly, You need to Download and Install SSIS PowerPack from here (Skip this if you already did)
  2. Launch Visual Studio, Create or Open your existing SSIS Solution.
  3. In Visual Studio Project, drag and drop the SSIS ZS Xml Parser Task in the design pane from SSIS Toolbox.
    SSIS XML Parser Task - Drag and Drop
  4. Very first thing you need to do to File connection to configure SSIS connection manager.
  5. Let's, Right click on Connection Managers Panel to Create File Connection, so you can use Source Path, and Context Menu will appear, Select New Connection from the Context Menu.
    SSIS XML Parser Task - File Connection
  6. Double click on ZS XML Parser Task for configure it.
  7. Set AccessMode to connection and select connection we have created and use the following XML text into your file. For value Mappings set Target with LOG-TO-OUTPUT. This means that the values will be displayed in the SSIS Output panel.
    <catalog>
        <book id="bk101">
            <author>Gambardella, Matthew</author>
            <title>XML Developer's Guide</title>
            <genre>Computer</genre>
            <price>44.95</price>
            <publish_date>2000-10-01</publish_date>
            <description>
                An in-depth look at creating applications
                with XML.
            </description>
        </book>
        <book id="bk102">
            <author>Ralls, Kim</author>
            <title>Midnight Rain</title>
            <genre>Fantasy</genre>
            <price>5.95</price>
            <publish_date>2000-12-16</publish_date>
            <description>
                A former architect battles corporate zombies,
                an evil sorceress, and her own childhood to become queen
                of the world.
            </description>
        </book>
        <book id="bk103">
            <author>Corets, Eva</author>
            <title>Maeve Ascendant</title>
            <genre>Fantasy</genre>
            <price>5.95</price>
            <publish_date>2000-11-17</publish_date>
            <description>
                After the collapse of a nanotechnology
                society in England, the young survivors lay the
                foundation for a new society.
            </description>
        </book>
        <book id="bk104">
            <author>Corets, Eva</author>
            <title>Oberon's Legacy</title>
            <genre>Fantasy</genre>
            <price>5.95</price>
            <publish_date>2001-03-10</publish_date>
            <description>
                In post-apocalypse England, the mysterious
                agent known only as Oberon helps to create a new life
                for the inhabitants of London. Sequel to Maeve
                Ascendant.
            </description>
        </book>
    </catalog>
    
    SSIS XML Parser Task - Extract data from XML using XPath expression
  8. In the above step you can Select Variable as Input or use placeholder in Direct string (e.g {{Use::varHtml}} ).
  9. You can Target to Variable if you like to save extracted value in output log or messagebox, for that check our blog click here.
  10. Click on OK button to save XML Parser Task configure setting UI.
  11. Here also connect ZS Logging Task to show extracted value.
  12. Finally, run the packages and check the output. If you cannot see the output, go to View in the menu and select Output.
    SSIS XML Parser Task - Execute

Properties

Property Name Description
SourceAccessMode Access mode for source data you want to parse.

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Direct [0] Direct
Variable [1] Variable
Connection [2] Connection
SourceVariable Variable which holds input string
SourceConnection Connection which holds input File path
SourceDirectValue Direct input text
TargetSettings Target settings for each extracted value from input text
LoggingMode

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Normal [0] Normal
Medium [1] Medium
Detailed [2] Detailed
Debugging [3] Debugging
PrefixTimestamp When you enable this property it will prefix timestamp before Log messages.

Setting UI


SSIS XML Parser Task - Setting UI
SSIS XML Parser Task - Setting UI

See Also

Articles / Tutorials


Copyrights reserved. ZappySys LLC.