cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Winkler, Steve" <steve.wink...@sapmarkets.com>
Subject RE: random stylesheets
Date Thu, 22 Feb 2001 21:37:11 GMT


You may also want to have an array with the actual names of the stylesheet
and then use the random function below to access the index.  That way it
would be easier to manage your stylesheets and know which one is which.  

-----Original Message-----
From: Pål Wester [mailto:pal.wester.list@florence.never.no]
Sent: Thursday, February 22, 2001 1:28 PM
To: cocoon-users@xml.apache.org
Subject: SV: random stylesheets


Have several stylesheets called: stylesheet1.xsl -> sylesheet10.xsl,
then try this:

<xsp:logic>
	int random = (Math.random()*10)+1;
</xsp:logic>
<xsp:pi target="xml-stylesheet">
                href="stylesheet<xsp:expr>random</xsp:expr>.xsl"
                type="text/xsl"
</xsp:pi>


Math.random isn't the best thing to use to get real-randomness,
so you should use something else... but this is just as an example.

mvh:
Pål Wester, programmerer
never.no as, stortingsgt 30, 0161 Oslo
direkte: 22 01 66 34, 906 900 62
tlf: 22 01 66 34, fax: 22 01 66 21
http://never.no - icq:103476059
~ hvis du ikke klarer det på første forsøk vil jeg ikke anbefale hangliding
~

> -----Opprinnelig melding-----
> Fra: Jonathan Coe [mailto:jonathan@onemind.com]
> Sendt: 22. februar 2001 20:11
> Til: cocoon-users@xml.apache.org
> Emne: random stylesheets
>
>
> Is it possible for an xml file to choose its stylesheet at
> random?  perhaps
> using an xsp solution?  i'd like to do a site that works similar to
> www.davidbowie.com (hit refresh several times) - same content, different
> looks and styles.  i realise a server redirect or javascript
> solution could
> work to achieve the same effect, but i'd like to contain everything in the
> xml doc. if at all possible.
>
> cheers,
> JC
>
>
>
> ----- Original Message -----
> From: <cocoon-users-digest-help@xml.apache.org>
> To: <cocoon-users@xml.apache.org>
> Sent: Thursday, February 22, 2001 1:47 PM
> Subject: cocoon-users Digest 22 Feb 2001 18:47:28 -0000 Issue 604
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message