Boopathy S
asked on
Need to remove empty space <p> Tag
I want to remove the empty space <p> element using XSL:
XML I'm having:
<Body>
<p> </p>
<h1>AAA</h1>
<p>aaa</p>
</Body>
XSL I Used:
<xsl:strip-space elements="p"/>
<xsl:template match="Body">
<xsl:copy>
<h1><xsl:value-of select="h1[normalize-space ()]" separator=" "/></h1>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="h1"/>
<xsl:template match="p[not(normalize-spa ce())]"/>
Output I'm getting like:
<Body>
<h1>AAA</h1>
<p> </p>
<p>aaa</p>
</Body>
Expected output be like:
<Body>
<h1>AAA</h1>
<p>aaa</p>
</Body>
Need to remove the empty space para tags. Please suggest code. Thanks in advance
XML I'm having:
<Body>
<p> </p>
<h1>AAA</h1>
<p>aaa</p>
</Body>
XSL I Used:
<xsl:strip-space elements="p"/>
<xsl:template match="Body">
<xsl:copy>
<h1><xsl:value-of select="h1[normalize-space
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="h1"/>
<xsl:template match="p[not(normalize-spa
Output I'm getting like:
<Body>
<h1>AAA</h1>
<p> </p>
<p>aaa</p>
</Body>
Expected output be like:
<Body>
<h1>AAA</h1>
<p>aaa</p>
</Body>
Need to remove the empty space para tags. Please suggest code. Thanks in advance
I think the approach from my response in your previous question is exactly what you need
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks