Below is an extract of an xml file
<JobList>
<Job id="Hotel" start="2016-10-06" />
<Job id="Cleaning" start="2016-10-06" />
<Job id="Floor" start="2016-10-06" />
<Job id="Training" start="2016-10-06" />
<Job id="Meeting" start="2016-10-06" />
<Job id="CI" start="2016-10-06" />
<Job titleId="Kitchen Associate" id="Kitchen" start="2016-10-06" rank="18">
In need to return the "titleId" and "start" from the last line.
If I write the following code I can get the titleId, "Kitchen Associate" no problems.
gc "\\path\fil.xml" | Select-Xml -XPATH "//Job/@start" | select * -expandproperty node | Select titleID
But I can't seem to return the RELATED start date as it will return back all seven of the start dates from the JobList. Is there a way of limiting the results such that it only takes it from where titleID also exists?
Thanks