Monday, February 21, 2022

OIC - How to group data using for each group XSLT 2.0 element

Use case:

Here we will show you how to group data Name element . In the below, we can see Name value is duplicated that we will take distinguish name values using for each group XSLT element.

We will use for-each-group element on Input and group by Name.

Input:

{"Input":[{

"Name": "Sanddy",

"Title":"Title"

},

{

"Name": "Sanddy",

"Title":"Title"

},

{

"Name": "Sanddy2",

"Title":"Title"

}

}]} 

Output:

{"Output":[{

"Greeting": "Hi Sanddy"

},

{

"Greeting": "Hi Sanddy"

}]

}

One sample code:

<xsl:template match="Person">

<xsl:for-each-group select="Student/Info" group-by="@Country">

<Country name="{current-grouping-key()}">

</country>

</xsl:for-each-group>

</xsl:template>

POC with Screenshots:












No comments:

Post a Comment

Featured Post

OIC – ERP Event Subscriber Adapter Error: java.io.IOException: Error retrieving access token

Overview While configuring the Oracle ERP Event Subscriber Adapter in OIC, an error occurred when opening the adapter configuration page. Ob...