I have xml like this:
<configurationData>
<path name='b'>
<path name='a'>
<setting name='s1'>
![CDATA[XXXX]]
</setting>
<setting name='s2'>
XXXX
</setting>
</path>
</path>
</configurationData>
where configurationData is the root node, and there can be may nested paths followed by one or more setting nodes. I want to convert the setting node to put the contents of the setting node into a child node called value
<configurationData>
<path name='b'>
<path name='a'>
<setting name='s1'>
<value>![CDATA[XXXX]]</value>
</setting>
<setting name='s2'>
<value>XXXX</value>
</setting>
</path>
</path>
</configurationData>
I must admit I find XML a mental road block and I cannot see what XSLT to use:
This is my attempt:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding ="utf-8" indent="yes" method="xml" version="1.0"/>
<xsl:template match='/setting'>
<xsl:apply-templates select='setting' />
</xsl:template>
<xsl:template match='setting'>
<value>
<xsl:value-of select='.'/>
</value>
</xsl:template>
</xsl:stylesheet>