I need to translate an XML from the source format to the target name value pairs for generic processing. Any tips on how to achieve this please? I am trying to use MapForce if it's easier.
From
<products>
<product>
<type>Monitor</type>
<size>22</size>
<brand>EIZO</brand>
</product>
<product>
......
</product>
</products>
to
<products>
<product num="1">
<attribute name="type">Monitor</attribute>
<attribute name="size">22</attribute>
<attribute name="brand">EIZO</attribute>
</product>
<product num="2">
....
</product>
</products>
I presume I need to use xsl:for-each in the element to generate the element?
How about the "num" attribute, it's just a counter basically. could it be position()?
Many Thanks!!
Haven't tested this, but you could do something like the following: