0

I have this code.

<trade>
    <exerciseDate>
        <adjustedDate>2023-03-10</adjustedDate>
    </exerciseDate>
    <cashPaymentDate>
        <adjustedDate>2023-03-14</adjustedDate>
    </cashPaymentDate>
    <currency>EUR</currency>
<effectiveDate>
    <adjustedDate>2023-03-14</adjustedDate>
    <dateAdjustments>
        <businessDayConvention>NONE</businessDayConvention>
    </dateAdjustments>
</effectiveDate>
<terminationDate>
    <unadjustedDate>2024-03-14</unadjustedDate>
        <dateAdjustments>
            <businessDayConvention>MODFOLLOWING</businessDayConvention>
        </dateAdjustments>
</terminationDate>
</trade>

I would like to receive as XSLT (ver.3.0) only 1 value. Like below. The logic is Friday - 2023-03-10, Tuesday -2023-03-14. Difference 4 Calendar Days. But I would like to receive value 2 ( that excluding Saturday and Sunday ) 'Business Days'

<workingDate>2</workingDate>

Can you please assist with using XPath's? I mean I want to use there XPath somewhere in template, that can calculate difference only in Business Days(/trade/exerciseDate/adjustedDate - 1st day and /trade/cashPaymentDate/adjustedDate - 2nd day )

My goal is to create a template where I can only calculate the working dates that I have shown but using Xpath logic

michael.hor257k
  • 113,275
  • 6
  • 33
  • 51
Iamfitz
  • 19
  • 7

1 Answers1

1

You should be able to use the expression:

my:workdays-in-range(/trade/exerciseDate/adjustedDate, trade/cashPaymentDate/adjustedDate )

after defining the necessary functions as shown in your previous question.

michael.hor257k
  • 113,275
  • 6
  • 33
  • 51