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