[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Only copy nodes that have text at some point in th

Subject: RE: Only copy nodes that have text at some point in the tree
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Fri, 28 Sep 2001 22:19:40 +0100
RE:  Only copy nodes that have text at some point in th
Matt,
<xsl:template match="Product">
	<xsl:if test="descendant::*/text()">
		<xsl:copy-of select="." />
	</xsl:if>
</xsl:template>

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> mjyoungblut@xxxxxxx
> Sent: 28 September 2001 21:55
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Only copy nodes that have text at some point 
> in the tree
> 
> 
> Hi,
>      I know I have seen this question posed before, but I 
> can't seem to find it in the FAQ or in the archives.  Sorry 
> for the redundancy.
> 
> I only want to copy nodes that have a textual descendant. <Catalog>
>      <Product NodeID="A" Action="A">
>           <Child>
>                <Grandchild/>
>           </Child>
>      </Product>
>      <Product NodeID="B" Action="A">
>           <Child>
>                <Grandchild>Steven</Grandchild>
>           </Child>
>      </Product>
>      <Product NodeID="C" Action="A">
>           <Child>
>                <Grandchild>Paul</Grandchild>
>                <Grandchild/>
>           </Child>
>      </Product>
>      <Product NodeID="D" Action="A"/>
> 
> </Catalog>
> 
> I would expect the results to look like the following: <Catalog>
>      <Product NodeID="B" Action="A">
>           <Child>
>                <Grandchild>Steven</Grandchild>
>           </Child>
>      </Product>
>      <Product NodeID="C" Action="A">
>           <Child>
>                <Grandchild>Paul</Grandchild>
>           </Child>
>      </Product>
> </Catalog>
> 
> If somebody has a link or a solution to this problem, I would 
> appreciate it. Thanks,
>      Matt Youngblut
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.