Manipulating the current group elements in xsl.
Hi
We have developed Xsl template to extract XML output. The problem is we need to add an attribute to the current group element i.e COMPANIES. Any help with this highly appreciated.
xsl Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<SyncDCW_COMPANIES xmlns="http://www.ibm.com/maximo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" baseLanguage="EN">
<xsl:for-each-group select="/DATA/COMPANIES" group-by="./ADDRESS_LINE1">
<DCW_COMPANIESSet>
<xsl:copy-of select="current-group()" copy-namespaces="no" />
</DCW_COMPANIESSet>
</xsl:for-each-group>
</SyncDCW_COMPANIES>
</xsl:template>
</xsl:stylesheet>
Sample output:
<?xml version="1.0" encoding="UTF-8"?>