Abstract For a long time, how to convert a line of data has always been a very common problem. This article describes how to convert XML with XSL. XML data is taken from row data of the database, and then use the XSL conversion output as column data.
In the example, the groupID element is used as row data, and the transformed column data is indicated by tradeID.
Use XSL: Key to generate a unique key for each GroupID.
Variable 1stGroupId is the entrance of all substro of GroupID. Use
Each GroupID calls the showtradesingroup template.
In the ShowTradesingRoup template, loop get all the subtots of GroupID.
XML data (record record in the database table): XML Version = "1.0"?>
XSLT code:
xsl: Text> xsl: for-each> xsl: template>
xsl: stylesheet>
The result is: 244133L, 244133L_EUR_STUB, 325867L_EUR_STUB1, 325867L_EUR_STUB2325866L, 325866L_EUR_STUB5027222L, 502722L_EUR_STUB, 502722L_EUR_STUB1, 502722L_EUR_STUB2