This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Only copy nodes that have text at some point in the tree
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Only copy nodes that have text at some point in the tree
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- Date: Sat, 29 Sep 2001 00:17:26 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Matt,
But that is what descendant::*/text() does.
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
> mjyoungblut@mmm.com
> Sent: 28 September 2001 23:47
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] Only copy nodes that have text at some
> point in the tree
>
>
>
> >Doesn't xsl:value-of look for the first text content all the
> way down
> >the whole branch?
>
> This still only checks the current node. I need to be able
> to traverse down the tree and remove empty elements from any
> child node as well. Matt
>
>
>
>
> "Thomas B.
>
> Passin" To:
> xsl-list@lists.mulberrytech.com
> <tpassin@mitret cc: (bcc:
> Matthew J. Youngblut/US-Corporate/3M/US)
> ek.org> Subject: Re:
> [xsl] Only copy nodes that have text at some point in
> the tree
>
> 09/28/2001
>
> 05:17 PM
>
> Please respond
>
> to xsl-list
>
>
>
>
>
>
>
>
>
>
> [<mjyoungblut@mmm.com>]
> >
> > This takes care of all of the product nodes, but what about the
> > <Grandchild> node for <Product NodeID='C'>? This should also be
> > removed. Is there a recursive way of solving this problem?
> >
>
> Doesn't xsl:value-of look for the first text content all the
> way down the whole branch? If so, you could test like this:
>
> <xsl:variable name='is-there-any-text'>
> <xsl:value-of select='.'>
> </xsl:variable>
>
> <xsl:if test='$is-there-any-text !=""'>....</xsl:if>
>
> Sorry all those quotes are hard to read, just get them to nest right.
>
> Cheers,
>
> Tom P
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
>
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list