I have an xml file that I am loading and want to ensure that I get only the unique values in the file. Hence, I am currently using:
<xsl:if test="not(preceding::c:FinancialAwardYear[local-name(..) = $fundName] and preceding::c:MPNID[text() = $response/c:MPNID/text()] and preceding::c:FinancialAwardNumber[text() = $response/../c:FinancialAwardNumber/text()])">
..however, I am not getting the unique values, rather getting one value of each matching type- typically the first one encountered. Doesn't the and make this a unique key? What should I be doing differently so as to consider all the above elements as a key so to speak when trying to obtain a unique value? I do not want to check just the preceding-sibling but rather everything that was before this element
Here is a sample file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<CommonRecord xmlns="http://www.ed.gov/FSA/COD/2010/v3.0d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ed.gov/FSA/COD/2010/v3.0d CommonRecord3.0d.xsd">
<TransmissionData>
<DocumentID>2010-09-30T02:55:48.6300000003</DocumentID>
<CreatedDateTime>2010-09-30T04:33:58.86</CreatedDateTime>
<Source>
<COD>
<RoutingID>00000001</RoutingID>
</COD>
</Source>
<Destination>
<School>
<RoutingID>--------</RoutingID>
</School>
</Destination>
<FullResponseCode>F</FullResponseCode>
</TransmissionData>
<ReportingSchool>
<RoutingID>26321103</RoutingID>
<AttendedSchool>
<RoutingID>26321103</RoutingID>
<Student>
<Index>
<SSN>000112222</SSN>
<BirthDate>yyyy-mm-dd</BirthDate>
<LastName>GOSSARD</LastName>
</Index>
<Name>
<FirstName>STACY</FirstName>
<MiddleInitial>L</MiddleInitial>
</Name>
<DLSubsidized>
<AwardKey>01</AwardKey>
<FinancialAwardYear>2011</FinancialAwardYear>
<FinancialAwardNumber>001</FinancialAwardNumber>
<FinancialAwardID>000112222S11G12911001</FinancialAwardID>
<Response>
<ResponseCode>A</ResponseCode>
<EMPNIndicator>false</EMPNIndicator>
<MPNID>000112222M11G12911101</MPNID>
<MPNStatusCode>A</MPNStatusCode>
<MPNLinkIndicator>true</MPNLinkIndicator>
<MPNExpirationDate>2011-09-28</MPNExpirationDate>
</Response>
</DLSubsidized>
<DLUnsubsidized>
<AwardKey>01</AwardKey>
<FinancialAwardYear>2011</FinancialAwardYear>
<FinancialAwardNumber>002</FinancialAwardNumber>
<FinancialAwardID>000112222S11G12911001</FinancialAwardID>
<Response>
<ResponseCode>A</ResponseCode>
<EMPNIndicator>false</EMPNIndicator>
<MPNID>000112222M11G12911101</MPNID>
<MPNStatusCode>P</MPNStatusCode>
<MPNLinkIndicator>true</MPNLinkIndicator>
<MPNExpirationDate>2011-09-28</MPNExpirationDate>
</Response>
</DLUnsubsidized>
<Response>
<ResponseCode>A</ResponseCode>
</Response>
</Student>
<Student>
<Index>
<SSN>000112222</SSN>
<BirthDate>yyyy-mm-dd</BirthDate>
<LastName>GOSSARD</LastName>
</Index>
<Name>
<FirstName>STACY</FirstName>
<MiddleInitial>L</MiddleInitial>
</Name>
<DLSubsidized>
<AwardKey>01</AwardKey>
<FinancialAwardYear>2011</FinancialAwardYear>
<FinancialAwardNumber>001</FinancialAwardNumber>
<FinancialAwardID>000112222S11G12911001</FinancialAwardID>
<Response>
<ResponseCode>A</ResponseCode>
<EMPNIndicator>false</EMPNIndicator>
<MPNID>000112222M11G12911101</MPNID>
<MPNStatusCode>A</MPNStatusCode>
<MPNLinkIndicator>true</MPNLinkIndicator>
<MPNExpirationDate>2011-09-28</MPNExpirationDate>
</Response>
</DLSubsidized>
<Response>
<ResponseCode>A</ResponseCode>
</Response>
</Student>
<Response>
<ResponseCode>A</ResponseCode>
</Response>
</AttendedSchool>
<Response>
<ResponseCode>A</ResponseCode>
</Response>
</ReportingSchool>
<Response>
<DocumentTypeCode>PN</DocumentTypeCode>
<DocumentStatusCode>A</DocumentStatusCode>
<ProcessDate>2010-09-30</ProcessDate>
</Response>
</CommonRecord>