I would like to get TicketDate where ChargeID is the same as CitationCharge/ChargeID. There could be several ChargeIDs with several CitationIDs. So I will need to check where ChargeID matches CitationCharge/ChargeID so that I get the right TicketDate. The TicketDate is the same as xsl element <ncate>
Desired output should look like this
XML
xsl
Desired output should look like this
XML:
<nc:ActivityDate>2014-03-26</nc:ActivityDate>
XML
XML:
<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="[URL unfurl="true"]http://tsgweb.com"[/URL] xmlns:IXML="[URL unfurl="true"]http://tsgweb.com"[/URL] xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="IXML Case Notification Test" MessageID="67084253" xmlns="">
<Case Op="E" InternalID="1617090499" ID="12125626" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
<Charge ID="10906090" PartyID="16765959" InternalChargeID="1616713754" InternalPartyID="1614667066" xmlns:reslib="urn:reslib">
<ChargeOffenseDate>04/13/2015</ChargeOffenseDate>
<ChargeHistory ChargeHistoryID="42933438" Stage="Case Filing" FilingSequence="1" CurrentCharge="true" InternalOffenseHistoryID="1637029057">
<ChargeNumber>1</ChargeNumber>
</ChargeHistory>
<ChargeHistory ChargeHistoryID="42933437" Stage="Citation Issued" CitationEventSequence="1" InternalOffenseHistoryID="1637029056">
<ChargeNumber>1</ChargeNumber>
</ChargeHistory>
<Deleted>false</Deleted>
</Charge>
<Charge ID="10906091" PartyID="16765959" InternalChargeID="1616713755" InternalPartyID="1614667066" xmlns:reslib="urn:reslib">
<ChargeOffenseDate>04/13/2015</ChargeOffenseDate>
<ChargeHistory ChargeHistoryID="42933440" Stage="Case Filing" FilingSequence="1" CurrentCharge="true" InternalOffenseHistoryID="1637029059">
<ChargeNumber>2</ChargeNumber>
</ChargeHistory>
<ChargeHistory ChargeHistoryID="42933439" Stage="Citation Issued" CitationEventSequence="1" InternalOffenseHistoryID="1637029058">
<ChargeNumber>2</ChargeNumber>
</ChargeHistory>
</Charge>
</Case>
<Citation ID="5385330" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
<CitationNumber>12345</CitationNumber>
<OffenseDate>04/13/2015</OffenseDate>
<TicketDate>04/13/2015</TicketDate>
<CitationCharge>
<ChargeID>10906090</ChargeID>
<ChargeHistoryID>42933437</ChargeHistoryID>
<ChargeNumber>1</ChargeNumber>
<SequenceNumber>1</SequenceNumber>
</CitationCharge>
</Citation>
<Citation ID="5385331" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
<CitationNumber>54321</CitationNumber>
<OffenseDate>04/13/2015</OffenseDate>
<TicketDate>04/13/2015</TicketDate>
<CitationCharge>
<ChargeID>10906091</ChargeID>
<ChargeHistoryID>42933439</ChargeHistoryID>
<ChargeNumber>2</ChargeNumber>
<SequenceNumber>1</SequenceNumber>
</CitationCharge>
</Citation>
</Integration>
xsl
Code:
<xsl:template name="ChargeDetails">
<ext:Citation>
<nc:AvtivityDate>
<xsl:if test="Charge[@ID=current()/../CitationCharge/ChargeID]">
<nc:Date>
<xsl:value-of select="mscef:formatDate(string(/Integration/Citation/TicketDate))"/>
</nc:Date>
</xsl:if>
</nc:AvtivityDate>
</ext:Citation>
</xsl:template>