I have an XML like below
<Screenings>
<Screening type="EFG" desc="Financial Report">
<ScreeningStatus>
<OrderStatus>Complete</OrderStatus>
<ResultStatus>Review</ResultStatus>
</ScreeningStatus>
</Screening>
<Screening type="EFG" desc="Financial Report">
<ScreeningStatus>
<OrderStatus>Complete</OrderStatus>
<ResultStatus>Fail</ResultStatus>
</ScreeningStatus>
</Screening>ngStatus>
</Screening>
<Screening subtype="CARG" type="ABCD" desc="registry search">
<ScreeningStatus>
<OrderStatus>InProgress</OrderStatus>
</ScreeningStatus>
</Screening>
<Screening subtype="CARG" type="ABCD" desc="registry search">
<ScreeningStatus>
<OrderStatus>InProgress</OrderStatus>
</ScreeningStatus>
</Screening>
<Screening subtype="KARG" type="ABCD">
<ScreeningStatus>
<OrderStatus>InProgress</OrderStatus>
</ScreeningStatus>
</Screening>
<Screening subtype="KARG" type="ABCD" desc="registry search">
<ScreeningStatus>
<OrderStatus>InProgress</OrderStatus>
</ScreeningStatus>
</Screening>
</Screenings>
I need a string like below (Get the unique type and subtype attributes)
EFG-|ABCD-CARG|ABCD-KARG
Then split this by pipe | and loop through it.
Inside loop I need type and subtype split by hyphen (-)
Need two variables for type and subtype - like below
for (split by pipe | val : array) {
split by hyphen and create two variable for type and subtype
(ABCD-KARG)
var type=ABCD
var subtype=KARG
// I have some business logic to do here
}
I tried this -
<xsl:variable name="typeSubTypeArray" select="string-join(./ns0:Screening/@type, ',')"/>
But I'm not able to get add the subtype value to it and create a unique combination value string
Also if it only type and no subtype the i'm getting unique value using this -
<xsl:for-each select="distinct-values(./ns0:Screening/@type))">
But how do I get the unique value using type/subtype combination. I need the attribute values.