Subject: Re: [xsl] [XSLT 1.0] Q: recursively eliminate empty nodes From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 08 Nov 2010 18:55:33 +0000 |
Hello,
I was given an identity transformation that eliminates empty nodes. <!-- identity template --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> <xsl:template match="*[not(node())]" />
I was asked on how to do this until all empty nodes are gone, even the newly created empty nodes after removal of an inner empty node. The question was on whether this can be done without applying the stylesheet again and again.
I came up with below (working) "XSLT 1.0 + exslt:node-set()" solution.
The question is, whether this can be done with pure XSLT 1.0? Especially I want to know whether it can be done without node-set() function -- just to make sure that not every problem looks like a nail given the exslt:node-set() hammer ...
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [XSLT 1.0] Q: recursively, Michael Kay | Thread | Re: [xsl] [XSLT 1.0] Q: recursively, Hermann Stamm-Wilbra |
Re: [xsl] [XSLT 1.0] Q: recursively, Andriy Gerasika | Date | Re: [xsl] [XSLT 1.0] Q: recursively, David Carlisle |
Month |