Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Pulling node value using SSIS XML Task Expand / Collapse
Author
Message
Posted Tuesday, September 4, 2012 6:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, September 14, 2013 1:39 PM
Points: 8, Visits: 105
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?
Post #1354278
Posted Tuesday, September 4, 2012 6:18 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:36 AM
Points: 6,131, Visits: 7,171
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 | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1354280
Posted Wednesday, September 5, 2012 7:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, September 14, 2013 1:39 PM
Points: 8, Visits: 105
I was thinking of adding the attribute as I drove home last night, thanks for verifying.
Post #1354548
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse