I am trying to get the value of an element that has two attributes and have tried several methods but am not being successful.
This query gets me the closest:
//*/@ID/(name(), data(.))
But it returns the 3 values from the following elements:
<Accession-ID ID="" Type="Clinic-AccID"/>
<Accession-ID ID="7666532" Type="Chart-ID"/>
<Accession-ID ID="B6490491" Type="Lab-AccID"/>
What I really want is the value for the element with a Type of Chart-ID.
Any ideas of how to do that would be greatly appreciated.
Below is more of the xml to give more context:
<?xml version="1.0" encoding="UTF-8"?>
<LabReport>
<Accession Acc-Result-ID="" Lab-ID="" LabClinicExt-ID="" Location-ID="" Order-Status="F">
<AccessionHeader>
<Accession-ID ID="" Type="Clinic-AccID"/>
<Accession-ID ID="7666532" Type="Chart-ID"/>
<Accession-ID ID="B6490491" Type="Lab-AccID"/>
<TimeStamp Type="Order Received DateTime" Value="04/05/2010 11:29 PM"/>
<Pet>
<Name>RACCOON 127</Name>
<Age/>
<Sex>F</Sex>
<Species Ext-ID=" "/>
<Breed Ext-ID=" ">RACCOON</Breed>
<Owner>WILDCARE</Owner>
<Doctor/>
</Pet>
</AccessionHeader>
.
.
.
</Accession>
</LabReport>
This query gets me the closest:
//*/@ID/(name(), data(.))
But it returns the 3 values from the following elements:
<Accession-ID ID="" Type="Clinic-AccID"/>
<Accession-ID ID="7666532" Type="Chart-ID"/>
<Accession-ID ID="B6490491" Type="Lab-AccID"/>
What I really want is the value for the element with a Type of Chart-ID.
Any ideas of how to do that would be greatly appreciated.
Below is more of the xml to give more context:
<?xml version="1.0" encoding="UTF-8"?>
<LabReport>
<Accession Acc-Result-ID="" Lab-ID="" LabClinicExt-ID="" Location-ID="" Order-Status="F">
<AccessionHeader>
<Accession-ID ID="" Type="Clinic-AccID"/>
<Accession-ID ID="7666532" Type="Chart-ID"/>
<Accession-ID ID="B6490491" Type="Lab-AccID"/>
<TimeStamp Type="Order Received DateTime" Value="04/05/2010 11:29 PM"/>
<Pet>
<Name>RACCOON 127</Name>
<Age/>
<Sex>F</Sex>
<Species Ext-ID=" "/>
<Breed Ext-ID=" ">RACCOON</Breed>
<Owner>WILDCARE</Owner>
<Doctor/>
</Pet>
</AccessionHeader>
.
.
.
</Accession>
</LabReport>