I have an xml document that is stored in sql server 2005 that I want to find all duplicate values from an id attribute within an xml element. The xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<session sessionValue="" id="ID-1">
<data id="ID-3">
<id>d394E6FF844734CB9A5E8B17612DC050A</id>
<TotalResult>803</TotalResult>
<AgencyListRequestURL>http://ews.harleysvillegroup.com:5555/invoke/HmiPortalDCTRedirect.flows:getAgencyList</AgencyListRequestURL>
<system id="systemid">
<global id="ID-2">
<id>gEBE0E6C2D61340698B264E30D1B2DC59</id>
<Button />
<GlobalOutputSpacer />
<Spacer />
<LocationIDToCompare />
<MasterManuScriptID />
<CurrentVehicle />
</global>
<page id="ID-2">
<id>p7B81433D8EB4400CA775CB3F7F0AD4DE</id>
<DialogMode>0</DialogMode>
<DifferentAddress>0</DifferentAddress>
</page>
</system>
</data>
</session>
In this example I am looking to generate a sql result that looks in all the “ID” attributes in the entire XML document and will tell me that “ID-2” is a duplicate value.
Is this possible in XPATH?
Thanks for your help!