I am struggling to wrap my head around xslt... trying to convert the following xml:
<employees>
<employee>
<employeeNumber>1234</employeeNumber>
<startdate>01/02/2003</startdate>
<activeFlag>true</activeFlag>
<firstname>Erik</firstname>
<address>
<addressline1>123 Main</addressline1>
<zip>07016</zip>
<state>New Jersey</state>
<city>My City</city>
</address>
</employee>
</employees>
into this (i.e. taking the activeFlag tag value out and putting it into an attribute of the employee tag instead).
<employees>
<employee active="true">
<employeeNumber>1234</employeeNumber>
<startdate>01/02/2003</startdate>
<firstname>Erik</firstname>
<address>
<addressline1>123 Main</addressline1>
<zip>07016</zip>
<state>New Jersey</state>
<city>My City</city>
</address>
</employee>
</employees>
I've tried the following XSLT, but it just does nothing:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="employees/employee">
<employee active="{activeFlag}"/>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Any ideas?