Question & Answer
Question
How to remove all the attributes including xsi:nil="true" from a XML file using XSLT?
Answer
Below is the XSLT that needs to be used to remove all the attributes from a xml file.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="*/@*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
[{"Product":{"code":"SSGR73","label":"IBM Cast Iron Cloud Integration"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"5.0.1.8;6.0.0.5;6.1.0.6","Edition":"Virtual;Physical;Cloud","Line of Business":{"code":"LOB45","label":"Automation"}}]
Historical Number
00000650
Product Synonym
Cast Iron Solution;Cast Iron Operating System;Cast Iron Studio
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21453204