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

Re: Find node with no child text() nodes

Subject: Re: Find node with no child text() nodes
From: Piet van Oostrum <piet@xxxxxxxxxxxxxx>
Date: Thu, 5 May 2011 09:43:40 +0200
Re:  Find node with no child text() nodes
Karl Stubsjoen wrote:

 > Need help with XSLT 1.0 template please.  How do you match on block_x
 > when no descendant text() nodes exist?  Note:  there is no predictive
 > knowledge of the depth of block within block_x.  In sample below,
 > block_x id 2 should match.  Like:
 > <blocks>
 >   <block_x id="1">
 >     <block/>
 >     <block/>
 >     <block>asdf</block>
 >   </block_x>
 >   <block_x id="2">
 >     <block/>
 >     <block>
 >        <sub_block/>
 >     </block>
 > </block_x>
 > </blocks>

Your description is not very clear. do you just want a block_x with id=2? Or
does the fact that is has no descendent text() play a role in the selection?

If only id=2 is important it would be:

<xsl:template match="//block_x[id='2']">

--
Piet van Oostrum
Utrecht, NL. URL: http://pietvanoostrum.com/

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.