Hi,
I need to create an XSLT which tranforms an attribute in the source xml to a new element in the target xml with the element name assigned the "Name" value of the attribute in the source xml.
Eg:
Source:
<ProductType>Fridge</ProductType>
<Features>
<Feature Name="ValveID">somename</Feature>
<Feature Name="KeyIdentifier">someID</Feature>
Result:
<Fridge>
<Feature>somename</Feature>
<Feature>someID</Feature>
Expected Result:
<Fridge>
<ValueID>somename</ValueID>
<KeyIdentifier>someID</KeyIdentifier>
My XSLT looks like this for now:
1 <Fridge>
2 <xsl:for-each select="$var6_ProductData/Features/Feature">
3 <xsl:variable name="var8_Feature" select="."/>
4 <xsl:element name="{name()}">
5 <xsl:value-of select="string($var8_Feature)"/>
6 </xsl:element>
7 </xsl:for-each>
8 </Fridge>
I need to change line 4 but not sure how. Any ideas??
D