We have a current system that outputs an XML file which is in the following format:
<ResultSet rowCount="2">
<Row>
<Entry>83708</Entry>
<mark>L24653338N1</mark>
<Processed>NO</Processed>
</Row>
<Row>
<Entry>99999</Entry>
<mark>L24653338N1</mark>
<Processed>YES</Processed>
</Row>
</ResultSet>
I need to transform into:
<ResultSet rowCount="2">
<Row Processed="NO">
<Entry>83708</Entry>
<mark>L24653338N1</mark>
<Processed>NO</Processed>
</Row>
<Row Processed="YES">
<Entry>99999</Entry>
<mark>L24653338N1</mark>
<Processed>YES</Processed>
</Row>
</ResultSet>
Does someone know how this can be done using .XSL?
Here is what I have done:
</xsl:template>
<xsl:template name="transform">
<Row>
<xsl:if test="$linecount>0">
<xsl:for-each select="/Msg/Body/Payload[./@Role='S']/Msg/Body/Payload[./@sql]/SqlResult/ResultSet/Row">
<xsl:attribute name="pos"><xsl:value-of select="position()"/></xsl:attribute>
<Entry>
<xsl:value-of select="./Entry"/>
</Entry>
<mark>
<xsl:value-of select="./mark"/>
</mark>
<Proccessed>
<xsl:value-of select="./Proccessed"/>
</Proccessed>
</xsl:for-each>
</xsl:if>
</Row>
</xsl:template>
Rowand make it add aProcessedattribute to theRowand apply templates to its children.