โ11-22-2018 02:17 AM
Hi Team,
I have a requirement to delete the fields which are empty. Can you please help me on this.
Thanks and Regards,
Gopi Bekkanti.
โ05-28-2019 07:06 AM
Hi GBekkanti,
You can use the following XSLT lines to remove all empty elements from XML:
<xsl:stylesheet version=โ1.0โ xmlns:xsl=โXSLT Namespaceโ>
<xsl:output omit-xml-declaration=โyesโ indent=โyesโ/>
<xsl:strip-space elements=โ"/>
<xsl:template match="node()|@โ>
<xsl:copy>
<xsl:apply-templates select=โnode()|@โ/>
</xsl:copy>
</xsl:template>
<xsl:template match=โ[not(@||comment()|processing-instruction()) and normalize-space()=โโ]โ/>
</xsl:stylesheet>
removeEmptyElements.txt (458 Bytes)