Re: [xsl] Filter out elements that have one specific sub-element and nothing else

Subject: Re: [xsl] Filter out elements that have one specific sub-element and nothing else
From: Mark Lundquist <lundquist.mark@xxxxxxxxx>
Date: Wed, 21 Feb 2007 05:27:55 -0800
On Feb 21, 2007, at 5:05 AM, stephan@xxxxxxxxxx wrote:

I need to filter out this element:
    <listitem>
        <formatinfo color="blue" />
    </listitem>

The rule: if listitem contains only formatinfo and no other element or
text then remove it.

Hi Stephan, how about


	<xsl:template match="listitem [formatinfo [ not (sibling::* |
sibling::text()[normalize-space()]) ]]" />

cheers,
ml

Current Thread