Jump to content

How do I sort by Stage and by sequence numbers?


winkimjr2

Recommended Posts

I would like to count how many Stage=Disposition are there and also how many Stage=Case Filing are there in order to accomplish what the following requirements states. I am not sure how to do this.

 

For each unique ChargeID evaluate the ChargeHistory records. If, Stage=”Disposition Event” is found verify the number of DispositionEventSequence. If only “1” populate Charge Information, otherwise use the highest DispositionEventSequence to populate.

 

If no Stage=”Disposition Event” is found look for Stage=”Case Filing” to populate. If only “1” populate Charge information, otherwise use the highest Case Filing Filing Sequence to populate.

 

XML

<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="IXML Case Notification Test" MessageID="67078058" xmlns="">	<Case InternalID="1616807927" ID="11747370" xmlns:user="http://tylertechnologies.com">		<Charge ID="10547226" PartyID="16580814" CurrSentenceID="155092098" InternalChargeID="1616447618" InternalPartyID="1614482843" xmlns:reslib="urn:reslib">			<ChargeOffenseDate>03/26/2014</ChargeOffenseDate>			<ChargeHistory ChargeHistoryID="41490828" Stage="Case Filing" FilingSequence="1" InternalOffenseHistoryID="1635954993">				<ChargeNumber>1</ChargeNumber>				<ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate>				<Statute>					<StatuteDescription>Traffic Regulations - Failure to obey traffic control device</StatuteDescription>					<StatuteCode Word="169064a" InternalCodeID="66247">Traffic Regulations - Failure to obey traffic control device</StatuteCode>					<Degree Word="PMD">Petty Misdemeanor</Degree>				</Statute>				<Additional>					<LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation>				</Additional>			</ChargeHistory>			<ChargeHistory ChargeHistoryID="41490828" Stage="Case Filing" FilingSequence="2" InternalOffenseHistoryID="1635954993">				<ChargeNumber>2</ChargeNumber>				<ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate>				<Statute>					<StatuteDescription>Testing Case Filling 2</StatuteDescription>					<StatuteCode Word="169064a" InternalCodeID="66247">Testing Case Filing 2</StatuteCode>					<Degree Word="PMD">Petty Misdemeanor</Degree>				</Statute>				<Additional>					<LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation>				</Additional>			</ChargeHistory>			<ChargeHistory ChargeHistoryID="41858685" Stage="Disposition Event" DispositionEventSequence="1" CurrentCharge="true" InternalOffenseHistoryID="1636250409">				<ChargeNumber>1</ChargeNumber>				<ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate>				<Statute>					<StatuteDescription>Traffic Regulations - Failure to obey traffic control device</StatuteDescription>					<StatuteCode Word="169064a" InternalCodeID="66247">Traffic Regulations - Failure to obey traffic control device</StatuteCode>					<Degree Word="PMD">Petty Misdemeanor</Degree>				</Statute>				<Additional>					<LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation>				</Additional>			</ChargeHistory>			<ChargeHistory ChargeHistoryID="41858685" Stage="Disposition Event" DispositionEventSequence="2" CurrentCharge="true" InternalOffenseHistoryID="1636250409">				<ChargeNumber>2</ChargeNumber>				<ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate>				<Statute>					<StatuteDescription>Testing second disposition number 2</StatuteDescription>					<Degree Word="PMD">Petty Misdemeanor</Degree>				</Statute>				<Additional>					<LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation>				</Additional>			</ChargeHistory>		</Charge>	</Case></Integration>

Xslt

<xsl:template name="Charge">	<ext:Charge>		<xsl:choose>			<xsl:when test="(count(ChargeHistory[@Stage='Disposition Event']))>0">				<j:ChargeSequenceID>					<xsl:value-of select="ChargeNumber"/>				</j:ChargeSequenceID>				<j:ChargeStatute>					<j:StatuteDescriptionText>						<xsl:value-of select="Statute/StatuteCode"/>					</j:StatuteDescriptionText>					<j:StatuteText>						<xsl:value-of select="Statute/StatuteCode/@Word"/>					</j:StatuteText>				</j:ChargeStatute>				<j:ChargeSeverityDescriptionText>					<xsl:value-of select="Statute/Degree"/>				</j:ChargeSeverityDescriptionText>			</xsl:when>			<xsl:otherwise></xsl:otherwise>		</xsl:choose>	</ext:Charge></xsl:template>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...