S
supergreat
Could someone help me with the XPath to select LastName from the below
xml without duplicating the name.
Note: There are two cities in the above tree that have the same
information, I just want to pick one, not the two,
and I want my select to check the two cities and just pick one... Here
is the one I wrote, It pick up two, I just
want one
/Residence/*/City[@id='16']/LastName
'Brown'
'Brown'
<Residence>
<California>
<City active="true" id="16">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
<City active="true" id="17">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
</California>
<Colorado>
<City active="true" id="16">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
<City active="true" id="17">
<FirstName>Mary</FirstName>
<LastName>Bob</LastName>
<Phone>(800) 445-2245</Phone>
<Fax>(800) 445-2200</Fax>
</City>
</Colorado>
</Residence>
xml without duplicating the name.
Note: There are two cities in the above tree that have the same
information, I just want to pick one, not the two,
and I want my select to check the two cities and just pick one... Here
is the one I wrote, It pick up two, I just
want one
/Residence/*/City[@id='16']/LastName
'Brown'
'Brown'
<Residence>
<California>
<City active="true" id="16">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
<City active="true" id="17">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
</California>
<Colorado>
<City active="true" id="16">
<FirstName>James</FirstName>
<LastName>Brown</LastName>
<Phone>(800) 445-4545</Phone>
<Fax>(800) 445-4500</Fax>
</City>
<City active="true" id="17">
<FirstName>Mary</FirstName>
<LastName>Bob</LastName>
<Phone>(800) 445-2245</Phone>
<Fax>(800) 445-2200</Fax>
</City>
</Colorado>
</Residence>