Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: How to remove nodes from the XML tree? (advanced) >Thread Next - Re: How to remove nodes from the XML tree? (advanced) Re: How to remove nodes from the XML tree? (advanced)To: NULL Date: 5/2/2007 7:53:00 PM Hi Dimitre, > <xsl:template match= > "*[* and not(descendant::*[not(*) and not(self::bad)])]"/> That's very elegant! And works beautifully. However, one small caveat.... Applied to the following:- <a> <bad/> </a> The stylesheet would return nothing. According to the strict requirement, that would be correct - although, personally, potentially producing an essentially non-well-formed document would concern me. Perhaps just a slight modification... <xsl:template match="*[* and parent::* and not(descendant::*[not(*) and not(self::bad)])]"/> would at least ensure the root element was re-produced. Cheers M | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
