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

Random?

Subject: Random?
From: Ali Choumane <ali.choumane@xxxxxxx>
Date: Fri, 29 Apr 2005 11:27:49 +0200
xsl random
Hi Dimitre,

I am using the template "randNext" in random.xsl :

...
<sentence>
 <xsl:attribute name="stamp">
     <xsl:call-template name="randNext">
         <xsl:with-param name="arg1" select="1"/>
     </xsl:call-template>
  </xsl:attribute>
  <xsl:attribute name="state">nonDesamb</xsl:attribute>
  <xsl:value-of select="concat($arg1/sentence[last()], $arg2)"/>
</sentence>
...

and this is a part of result of transformation:
...
  <sentence stamp="39022" state="nonDesamb">111 111 111</sentence>
  <sentence stamp="39022" state="nonDesamb"> 222 222</sentence>
  <sentence stamp="39022" state="nonDesamb"> 333 333 333</sentence>
  <sentence stamp="39022" state="nonDesamb"> 444 444 444</sentence>
  <sentence/>
  <sentence stamp="39022" state="nonDesamb">555 555 555</sentence>
  <sentence stamp="39022" state="nonDesamb"> 666 666 666</sentence>
  <sentence stamp="39022" state="nonDesamb"> 777 777 777</sentence>
  <sentence stamp="39022" state="nonDesamb"> 888 888 888, 999 999999</sentence>
...

As the result show, "stamp" it's not a key now. I think because "arg1" is 
fixed.

and I am using the template "randomSequence" in random.xsl, but it can't 
resolve the problem. 
I think , if I put a variable value of "arg1" , can resolve the problem? 
But how, when we can't change the value of variables in XSLT?

thanks,

Quoting Dimitre Novatchev <dnovatchev@xxxxxxxxx>:

> On 4/29/05, Ali Choumane <ali.choumane@xxxxxxx> wrote:
> > Hi,
> > the solution provided by Dimitre for breaking string into substrings or
> > arrays, was satisfying for my application.
> > 
> > In this part of xslt code:
> > <sentence>
> >  <xsl:attribute name="stamp">Key</xsl:attribute>
> >  <xsl:value-of select="concat($arg1/sentence[last()], $arg2)"/>
> > </sentence>
> > 
> > I need to give a random value to the "Key" because I have many "sentence"
> as a
> > result's transformation,
> > 
> > can you help me?
> 
> 
> Yes, use the templates in 
> 
>        random.xsl 
> 
> from FXSL.
> 
> 
> A very detailed description is available at:
> 
> http://fxsl.sourceforge.net/articles/Random/Casting%20the%20Dice%20with%
20FXSL-htm.htm
> 
> 
> 
> Cheers,
> Dimitre Novatchev
> 


Ali CHOUMANE
M2R III ,Univ Joseph fourrier, UFR IMA
WAM/INRIA & GETA/CLIPS
portable.      06 71 55 80 65
Bureau(INRIA). 04 76 61 54 13 
Email. ali.choumane@xxxxxxx

-------------------------------------------------
envoyi via Webmail/IMAG !

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.