This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Finding the maximum depth from a node



I wrote:
>     <xsl:template match="myDepthCompare:*">
>       <xsl:param name="arg1" select="/.."/>
>       <xsl:param name="arg2" select="/.."/>
>       
>       <xsl:if test="$arg1/@name > $arg2/@name">1</xsl:if>
>     </xsl:template>
> </xsl:stylesheet>
> 
> 

Ooopsss.... I should compare the depths! (Sorry, but it is Friday
night):

 <xsl:template match="myDepthCompare:*">
      <xsl:param name="arg1" select="/.."/>
      <xsl:param name="arg2" select="/.."/>
      
      <xsl:if test="count($arg1/ancestor::folder) 
                        > count($arg2/ancestor::folder)">1</xsl:if>
    </xsl:template>

Otherwise the result is exactly the same... :o)

Cheers,
Dimitre.

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]