Xpath Query question

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I am writing a simple app to verify the data in an SSIS xml package. There are a load of connection managers, but I need to only look at particular ones.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ConnectionManager<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DelayValidation<span style="color:Black; "<span style="color:Blue; >-1<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ObjectName<span style="color:Black; "<span style="color:Blue; >Opening RAB NBV<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DTSID<span style="color:Black; "<span style="color:Blue; >{07E4A802-8A64-4B8E-ACC3-E0212DD81A55}<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Description<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; CreationName<span style="color:Black; "<span style="color:Blue; >EXCEL<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; PropertyExpression <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ExcelFilePath<span style="color:Black; "<span style="color:Blue; >@[User::SpreadsheetPath] + "Tariff Dx\Input\Opening RAB NBV.xls"<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; PropertyExpression<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ObjectData<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ConnectionManager<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Retain<span style="color:Black; "<span style="color:Blue; >0<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property <span style="color:Red; DTS:Name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ConnectionString<span style="color:Black; "<span style="color:Blue; >Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\BGGWRAP70iDST_INPUT_FILESDevTariff DxInputOpening RAB NBV.xls;Extended Properties="EXCEL 8.0;HDR=YES";<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; Property<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ConnectionManager<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ObjectData<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; DTS<span style="color:Blue; :<span style="color:#A31515; ConnectionManager<span style="color:Blue; >
[/code]
I have played around with my xpath query without success. In the above XML example, there is <DTS:Property DTS:Name="CreationName EXCEL</DTS:Property>. I would like to get an XmlNodelist containing all DTS:ConnectionManager nodes where the CreationName
property has a value of EXCEL, like in the example above.
Would really appreciate any help you can give.
Thanks

View the full article
 
Back
Top