How to Re-arrange xml elements using XSLT in C#.
Are you looking for a way to Re-arrange xml elements using XSLT in C# ? then read this thread to know how to re-arrange it
Hi,
This is my sample XSLT file.
<xsl:for-each select="Projects">
<xsl:copy-of select="Project_Id"/>
<xsl:for-each select="FieldDefs">
<FieldDefs>
<xsl:copy-of select="FieldDefId"/>
<FieldDefDescription><xsl:value-of select="FieldDescription"/></FieldDefDescription>
<xsl:copy-of select="FieldName"/>
<xsl:copy-of select="FieldPriority"/>
<xsl:copy-of select="FieldType"/>
</FieldDefs>
</xsl:for-each>
</xsl:for-each>
In the above example under project section I have project_id. The same Project_Id I need in under FieldDefs section, How to get that.
My desired output should be in below format.
<xsl:for-each select="Projects">
<xsl:for-each select="FieldDefs">
<FieldDefs>
<xsl:copy-of select="Project_Id"/>
<xsl:copy-of select="FieldDefId"/>
<FieldDefDescription><xsl:value-of select="FieldDescription"/></FieldDefDescription>
<xsl:copy-of select="FieldName"/>
<xsl:copy-of select="FieldPriority"/>
<xsl:copy-of select="FieldType"/>
</FieldDefs>
</xsl:for-each>
</xsl:for-each>
If any one know this then please guide me.
Regards,
Naveen