[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Looking to understand how this works?


Subject: [xsl] Looking to understand how this works?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Fri, 11 Apr 2003 07:49:14 -0400

Americo Albuquerque sent me some wonderful code to lay out outlined steps
using table/cells and a space variable. Although I understand there are
alternatives, I actually could understand most of this!  But I would love to
understand:

(1) The significance of the math to calculate the space variable? Take the
count (ie level) of the step multiply by 12 + 1 multiply by 7...just
curious.

(2) What does the line <xsl:apply-templates select="*[not(self::step)]"/>
mean?

Thanks.  Kathy

Here it is:

<xsl:variable name="space" select="(count(ancestor::step) * 12 + 1) * 7"/>
<tr>   
<td width="5%" valign="top">
<xsl:apply-templates select="@ckbox[.='yes']"/>   
</td>   
<td valign="top">
	<table width="100%" border="0" cellpadding="0">
	<tr>      
	<td valign="top" width="{$space}">
		<table border="0" cellpadding="0">
		<tr>         
		<td valign="top" width="{$space}">&#160;&#160;
</td>
		<td valign="top">
		<xsl:number level="multiple" count="step"
format="1.1"/>
		<xsl:if test="not(ancestor::step)">
			<xsl:text>.</xsl:text>
		</xsl:if>         
		<xsl:text>&#160;&#160;</xsl:text>
			</td>
			</tr>      
			</table>      
		</td>      
		<td>       
		<xsl:apply-templates select="*[not(self::step)]"/>      
	</td>     
	</tr>    
	</table>   
</td>  
</tr>  
		<xsl:apply-templates select="step"/> 
	</xsl:template> 


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



Current Thread