Just got into a new xml issue I'm little stuck with. Maybe somebody can push me into the right direction :)
I have an XML looking like this:
<import xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///XXXXXXXXX/TraumaSchema.xsd">
<creationDate>2016-10-18</creationDate>
<hospitalCode>XXXXXXXXXXXX</hospitalCode>
<importCasesWithErrors>0</importCasesWithErrors>
<caseState>1</caseState>
<caseList>
<case>
<patientCode>XXXXXXXXXXX</patientCode>
<internalPatientId>XXXXXXXXXXXXXXX</internalPatientId>
<masterData>
<patient>
<age/>
<sex>1</sex>
<asa>1</asa>
</patient>
<accident>
<cause>1</cause>
<trauma>1</trauma>
<dateTime>
<date>2016-05-15</date>
<time>01:30:00</time>
</dateTime>
</accident>
</masterData>
<preClinicalData>
<alarm>
<date>2016-05-15</date>
<time>02:00:00</time>
</alarm>
<arrival>
<date>2016-05-15</date>
<time>01:30:00</time>
</arrival>
<departure>
<date>2016-05-15</date>
<time/>
</departure>
<vitalSign>
<capnometry>0</capnometry>
<systolicBloodPressure>
<mmHg>140</mmHg>
</systolicBloodPressure>
<heartRate>
<perMinute>130</perMinute>
</heartRate>
<respiratoryRate>
<perMinute>20</perMinute>
</respiratoryRate>
<oxygenSaturation>
<percent>97</percent>
</oxygenSaturation>
</vitalSign>
....
....
....
</case>
<case>
....
....
....
The XML is quite big and two things are important to know. There is an element "caseList" which contains a variable number of cases -> "case". Each "case" consists of many other elements. The Element in focus is "patientCode" which is contained in any case-group.
What I need to achieve is to get this parent element "patientCode" starting from any possible child node.
I do not know from where in the hierarchy I have to start. The only thing I know is that I need to get the this particular parent.
Does anybody have an idea how to achieve this?
Any help is very appreciated.
kind regards Sandro