I am trying to remove the xml node which is having empty values below my code
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:template match="node()|@*" >
<xsl:copy>
<xsl:apply-templates select="@*[.!='']" />
<xsl:apply-templates select="node()" />
</xsl:copy>
</xsl:template>
Input:
<Test><id value=""></id><name value="Test"></name></Test>
Output:
<Test><id /><name value="Test" /></Test>
Expected Output:
<Test><name value="Test" /></Test>
Here <id\> tag should remove. Please suggest where am missing.
Please help me to solve the above problem.