Grouping distinct issue on the XSLT 2.0

Mahesh Madhusanka 221 Reputation points
2020-09-06T14:38:11.287+00:00

Hi Team,

Currently i prepared XSLT 2.0 map for a build a grouping input XML Multiple repeat part and parse its as a structured method, But exept the few parts rest of mapping Working Fine, According to i have faced issue as a when i have same value muliple lines on the input XML, its getting Repeating, So i want to get a line Cont equal to each Event Count, For your reference here i have attached Sample Source XML, Current XSLT and Expected output, Could you please check and guide on this to sort out this issue.
Current Issue is Repeating Same value on the output file, I want to Capture data Base on the above event count number (event count number == Each event line count)

22814-image.png

Source XML.
-22902-source-xml.xml

Current XSLT- 22835-xslt-map.xml

Expected Output-
22846-image.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 26,586 Reputation points
    2020-09-06T17:33:43.48+00:00

    Hi Mahesh,

    You need to create a separate additional group for the ArrivalEventdate element.
    Please see below.

    XSLT fragment

    <Arrival>
     <EventCount>
     <xsl:copy-of select="ArrivalEventCount"/>
     </EventCount>
     <xsl:for-each-group group-by="ArrivalEventdate" select="/Booking/value">
     <Line_No>
     <xsl:copy-of select="position()"/>
     </Line_No>
     <xsl:copy-of select="ArrivalEventdate"/>
     <xsl:copy-of select="ArrivalEventDetail"/>
     </xsl:for-each-group>
    </Arrival>
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.