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

RE: following-sibling problem

Subject: RE: following-sibling problem
From: "Joe Heidenreich" <HeidenreichJ@xxxxxxxx>
Date: Tue, 2 Nov 2004 10:28:49 -0500
problem with ul tag
I'm not an XML/XSL master by any means, but I'll try and help here. The source
fragment provided doesn't match the output provided and I'm not sure how you
declare your bullet key. This is what I do see. You explicitly place the <ul>
tag everytime because it is embedded in your <li> tag from this code here:

> <xsl:for-each-group select="$bullet[not(@level='0')]"
group-starting-with="*[xs:integer(@level) eq $level]">
>    <li><xsl:value-of select="normalize-space(.)"/>
>       <ul>
>          <xsl:call-template name="process-level">
>          <xsl:with-param name="bullet" select="current-group() except ."/>
>          <xsl:with-param name="level" select="$level + 1"/>
>          </xsl:call-template>
>       </ul>
>    </li>
> </xsl:for-each-group>

It seems the reason your process-level isn't returning any <li> tags is
because there isn't a level 3. What's happening is you are outputting the <ul>
before checking to see whether there is a value. I think what you want to do
is check to see if:

<xsl:if test="@level < following-sibling::bullet[@level][1]">
	<ul>
		<xsl:apply-templates/> <-- You'll have to edit this
	</ul>
</xsl>

I'm assuming there aren't any empty bullet nodes. I'm also assuming bullets
are listed in order since ther edoesn't seem to be any attribute relating a
descendant bullet to its parent. Hopefully this helps.

-Joe

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.