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

Sort by depth of leaf-nodes

Subject: Sort by depth of leaf-nodes
From: Delaney Robin <Robin.Delaney@xxxxxxx>
Date: Fri, 6 Dec 2002 14:45:44 +0100
xsl get leaf nodes
Hello,

I've got the following XSL which gives me, the element-names of the leaf
nodes of the descendants of the first child of element Concat
(I think thats how it goes in English !). 

	<xsl:template match="Concat">
			<xsl:for-each select="(*[1]//*[not(*)])">	 
				<xsl:value-of select="name()"/>	
			</xsl:for-each> 	
 	</xsl:template>

I need to get the names for the "deepest" node  under Concat (ie. the
element with the most leaf nodes) which is not necessarily the first (as
above). I believe its a combination of taking the [1] out from the above
xpath expression and building in xsl:sort combined with count but my feeble
attempts come to nothing. Any help appreciated !

Rough XML snip:

<Concat>
<A>
   <B>1</B>
</A>
<A>
   <B>1</B>
   <C>2</C>
</A>
</Concat>

output needed:  BC 

 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.