Page 1 of 1

How do I display the most recent HearingDate?

Posted: Tue Jun 02, 2015 5:01 pm
by winkimjr2
What I want to do determining Hearing Date.

I want to evaluate the Hearing records in the xml document. If more than one Hearing ID is found, use the most recent HearingDate that has passed. Skip records where SettingID/Cancelled = “True”

If multiple hearings are on a case the most recent hearing date should be selected to populate the outbound message.
How do I do this?

xml document

Code: Select all

<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="" xmlns:IXML="" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67086844" xmlns="">
<Case InternalID="1616832909" ID="11783147" xmlns:user="">
<Hearing ID="153546512" InternalHearingEventID="1716143353">
<Setting ID="23490064" InternalSettingID="1623782066" Date="05/14/2014">-->
<Hearing ID="155794813" InternalHearingEventID="1717919318">
<Setting ID="23727431" InternalSettingID="1623950282" Date="07/09/2014">
<Hearing ID="158501312" InternalHearingEventID="1720225032">
<Setting ID="24032349" Cancelled="true" InternalSettingID="1624178189" Date="07/11/2014">

<Hearing ID="158551556" InternalHearingEventID="1720240342">
<Setting ID="24040436" InternalSettingID="1624179819" Date="08/20/2014">


My xsl line of code to get the HearingDate. I need to check for hearing and select the most recent HearingDate which do not have Hearing/Setting/@Cancelled="true"

Code: Select all

<xsl:value-of select="mscef:formatDate(string(Hearing/Setting[not(@Cancelled)]/HearingDate))"/>

Re: How do I display the most recent HearingDate?

Posted: Tue Jun 02, 2015 7:21 pm
by winkimjr2
I resolved this one

Code: Select all

<xsl:for-each select="Hearing/Setting[not(Cancelled)]">
<xsl:sort select="HearingDate" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="mscef:formatDate(string(HearingDate))"/>