Subject: Re: [xsl] How to strip off all empty elements from a XML doc? From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 07 Oct 2009 09:40:57 -0400 |
Just another question:
Assume a XML doc contains (sub)elements with no content like
<myelem22></myelem22> or <myelem22/>
How can I strip off/delete recursively ALL these empty elements from the XML element tree (but keep all others)?
<xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
-- Upcoming: hands-on code list, UBL, XSLT, XQuery and XSL-FO classes in Copenhagen Denmark and Washington DC USA, October/November 2009 Interested in other classes? http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to strip off all empty el, Ben Stover | Thread | Re: [xsl] How to strip off all empt, Martin Honnen |
[xsl] How to strip off all empty el, Ben Stover | Date | Re: [xsl] How to strip off all empt, Martin Honnen |
Month |