Jump to content
Sign in to follow this  
winkimjr2

How do I sort by Stage and by sequence numbers?

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>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...