Pulling node value using SSIS XML Task

  • I have a node ID that I need to pull (DataFile id="1") and place into a variable:

    <Metadata>

    <BatchProcessing>

    <OpenJob>

    <FileJournaling>

    <DataFile id="1"/>

    </FileJournaling>

    <Status>

    <StatusCd>0</StatusCd>

    <StatusType>"Ok "</StatusType>

    <StatusDescription>"Ok"</StatusDescription>

    </Status>

    </OpenJob>

    </BatchProcessing>

    </Metadata>

    I have an XML task set and I can pull the value of any other node except this one. Any ideas?

  • XML Task doesn't like attributes, it prefers only fully formed tags. When you want access to the attributes, you've got to fuss with it a bit.

    A brief example:

    http://www.mandsconsulting.com/ssis-tip-xpath-for-root-level-attributes-xml-tasks


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • I was thinking of adding the attribute as I drove home last night, thanks for verifying.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply