[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Get the most recent date

Subject: Get the most recent date
From: "LEGAULT, PHILLIP plegault@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Mar 2024 16:03:32 -0000
 Get the most recent date
I have an XML file with the following sections with date fields.
I need the latest sf:LastModifiedDate field when sf:ActivityCategory_GCC__c =
Additional Information



      <records xsi:type="sf:Task">
         <sf:Id xsi:nil="true"/>
         <sf:ActivityAwarenessDate_GCC__c>2023-11-05T00:28:00.000Z</sf:Activi
tyAwarenessDate_GCC__c>
         <sf:ActivityCategory_GCC__c>Additional
Information</sf:ActivityCategory_GCC__c>
         <sf:ActivityNumber_GCC__c>xxxxxxx</sf:ActivityNumber_GCC__c>
         <sf:ActivityType_GCC__c>Receive Phone Call</sf:ActivityType_GCC__c>
         <sf:DetailsDelayedAwareness_GCC__c>The delay occurred because there
was a data-entry omission of "Task" when the follow-up report was
created.</sf:DetailsDelayedAwareness_GCC__c>
         <sf:LastModifiedDate>2023-11-09T04:30:46.000Z</sf:LastModifiedDate>
         <sf:ReasonDelayedAwareness_GCC__c>Other
Cause</sf:ReasonDelayedAwareness_GCC__c>
         <sf:Subject>Task</sf:Subject>
         <sf:TranslationCompleted_GCC__c>true</sf:TranslationCompleted_GCC__c
>
      </records>
      <records xsi:type="sf:Task">
         <sf:Id xsi:nil="true"/>
         <sf:ActivityAwarenessDate_GCC__c>2024-01-23T05:46:01.000Z</sf:Activi
tyAwarenessDate_GCC__c>
         <sf:ActivityCategory_GCC__c>Additional
Information</sf:ActivityCategory_GCC__c>
         <sf:ActivityNumber_GCC__c>xxxxxx</sf:ActivityNumber_GCC__c>
         <sf:ActivityType_GCC__c>Receive Phone Call</sf:ActivityType_GCC__c>
         <sf:LastModifiedDate>2024-01-25T13:27:31.000Z</sf:LastModifiedDate>
         <sf:Subject>Task</sf:Subject>
         <sf:TranslationCompleted_GCC__c>true</sf:TranslationCompleted_GCC__c
>
      </records>

Here is what I have now xslt 2


Receipt Date: <xsl:choose>
<xsl:when test="/records/sf:Tasks/records/sf:ActivityCategory_GCC__c =
'Additional Information' and
max(/records/sf:Tasks/records/sf:ActivityAwarenessDate_GCC__c)">
  <xsl:value-of
select="format-dateTime(/records/sf:Tasks/records[sf:ActivityCategory_GCC__c=
'Additional
Information']/./sf:ActivityAwarenessDate_GCC__c,'[D01]-[MN,*-3]-[Y0001]')" />
</xsl:when>
<xsl:when test="/records/sf:Tasks/records/sf:ActivityCategory_GCC__c =
'Initial'">
  <xsl:value-of
select="format-dateTime(/records/sf:Tasks/records[sf:ActivityCategory_GCC__c=
'Initial'][1]/./sf:ActivityAwarenessDate_GCC__c,'[D01]-[MN,*-3]-[Y0001]')" />
</xsl:when>
</xsl:choose>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.