[Home] [By Thread] [By Date] [Recent Entries]
At 2010-11-08 19:22 +0100, Hermann Stamm-Wilbrandt wrote:
Are you defining, then, an "ultimately" empty node as being a node that doesn't have descendent text nodes? If not, then please clarify with more examples. The code below gives you what your recursive solution gives you, but I can't tell from your specification if that is what you really want. Perhaps you are simply looking too deep at the problem? I hope this helps. . . . . . . . . . Ken ~/t/ftemp $ cat hermann.xml
<a><b>c<c/></b><b><c/></b></a>
~/t/ftemp $ xslt hermann.xml hermann.xsl
<?xml version="1.0" encoding="utf-8"?><a><b>c</b></a>
~/t/ftemp $ cat hermann.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"><xsl:template match="*[not(.//text())]"/> <xsl:template match="@*|node()"><!--identity for all other nodes-->
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template></xsl:stylesheet> ~/t/ftemp $ -- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|

Cart



