[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A little Divinitation with generate-id()?
> If you don't care about good randomness, you could use "string-length(/) mod > 8", but really I think you need an external function here. Yes, I do agree ! It's XT specific, but on <XML>fr, I am rotating banners like this with the following template : <xsl:template match="document-banner"> <xsl:param name="cnt" select="count($layout/layout/site/banner)"/> <xsl:param name="rnd" select="math:random()"/> <xsl:param name="idx" select="round(($cnt -1) * $rnd) +1"/> <xsl:apply-templates select="$layout/layout/site/banner[position()=$idx]/*"/> </xsl:template> where the math prefix is defined as : xmlns:math="http://www.jclark.com/xt/java/java.lang.Math" and $layout is assigned to a document describing the site and pages layout. Hope this helps Eric -- ------------------------------------------------------------------------ Eric van der Vlist Dyomedea http://dyomedea.com http://xmlfr.org http://4xt.org http://ducotede.com ------------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|