I have an XML file like the below where I may have multiple records with a common child element like so:
<content xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07">
<ExportXML>
<record>
<job_id>19013280</job_id>
<title>Senior Services / Platform Engineer - LoungeBuddy</title>
<coll>abc</coll>
</record>
<record>
<job_id>19013280</job_id>
<title>Senior Services / Platform Engineer - LoungeBuddy</title>
<coll>xyz</coll>
</record>
</ExportXML>
</content>
How would I transform this to the below using XSLT 2.0?
<EF_Position>
<job_id>19013280</job_id>
<title>Senior Services / Platform Engineer - LoungeBuddy</title>
<coll1>
<coll>abc</coll>
<coll>xyz</coll>
</coll1>
</EF_Position>
I tried with code but some how it is not working.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:to="http://www.taleo.com/ws/integration/toolkit/2005/07" xmlns:util="http://www.mavixconsulting.com/2013/XSL/transform" exclude-result-prefixes="to util">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="./ExportXML">
<xsl:for-each-group select="record" group-by="job_id">
<EF_Position>
<xsl:sequence select="job_id" />
<title>
<xsl:value-of select="title"/>
</title>
<coll1>
<xsl:for-each select="current-group()">
<coll>
<xsl:value-of select="coll"/>
</coll>
</xsl:for-each>
</coll1>
</EF_Position>
</xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>
The issue is because of tag <content xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07">.
If I removed xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07" it is working fine.
I'm fairly new to XSLT so please excuse the potentially novice question. Any guidance would be appreciated here. Thanks in advance.