Page 1 of 1

XSLT 2.0 - Group by partial value of an attribute

Posted: Wed Aug 29, 2018 1:36 pm
by msambasiva
Hi,
We are using XSLT 2.0.

We have a requirement to group the services based on product which is part of an attribute value. Below is the part of xml taken to brief you the requirement.

In the below xml, there are three services. Two services are from commonWorkExecution prodcut.

The expected output is as follows
Product(Level 1) Service (Level 2)
commonWorkExecution
Work Order Material Transaction Service
Work Order Operation Transaction Service
orderPromising
Order Promising Service
<services>

<chapterSummary>
<text>This chapter describes the SOAP web services available for abc Sales Cloud.</text>
</chapterSummary>
<service anchor="abc.apps.scm.orderPromising.orderPromising.orderPromisingServiceV2.OrderPromisingService"/>
<service anchor="abc.apps.scm.commonWorkExecution.workOrderMaterialTransactions.materialTransactionsService.WorkOrderMaterialTransactionService"/>
<service anchor="abc.apps.scm.commonWorkExecution.operationTransactions.operationTransactionsService.WorkOrderOperationTransactionService"/>

Any clue would be really great help.

Thanks,
Samba.

Re: XSLT 2.0 - Group by partial value of an attribute

Posted: Thu Aug 30, 2018 8:27 am
by Radu
Hi,

Maybe you can use the XSL for-each-group:

https://www.w3.org/TR/xslt20/#grouping

Regards,
Radu