Hello, I am having a little bit of trouble with xpath.
I have an xml file in the following format:
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Sales%20Reps.xsd" generated="2012-01-30T17:08:58">
<Sales_x0020_Reps>
<SalesRepID>1</SalesRepID>
<LastName>Eissler</LastName>
<FirstName>Karean</FirstName>
<CustomerName>Abel & Young</CustomerName>
<Phone>3053756442</Phone>
</Sales_x0020_Reps>
<Sales_x0020_Reps>
<SalesRepID>3</SalesRepID>
<LastName>Pellum</LastName>
<FirstName>Kathryn</FirstName>
<CustomerName>Department of CIS</CustomerName>
<Phone>3053854431</Phone>
</Sales_x0020_Reps>
<Sales_x0020_Reps>
<SalesRepID>2</SalesRepID>
<LastName>Smith</LastName>
<FirstName>John</FirstName>
<CustomerName>Advantage Sales</CustomerName>
<Phone>3054445555</Phone>
</Sales_x0020_Reps>
</dataroot>
I need to retrieve a list unique list of sales reps and thier id’s. So far I have been able to get as far as getting a list of just the reps ID’s with this expression:
dataroot/Sales_x0020_Reps[not(SalesRepID=preceding-sibling::Sales_x0020_Reps/SalesRepID)]/SalesRepID
I am having a hard time figuring out how to select the ID, last name and first name however. This is the expression that I am trying to use to find unique combinations but it’s not working and I’m not sure how to get the 3 values out.
dataroot/Sales_x0020_Reps[not(concat(SalesRepID, LastName, FirstName)=preceding-sibling::Sales_x0020_Reps/concat(SalesRepID, LastName, FirstName))]
Any ideas?