RE: XForms/XPath expressions in 'value' of xforms:setvalue; how to generate a random string (to be used as password)

Posted by Denis Galiana on
URL: https://discuss.orbeon.com/XForms-XPath-expressions-in-value-of-xforms-setvalue-how-to-generate-a-random-string-to-be-used-as-p-tp43363p43364.html

I’ve succeeded with this code :

 

                                                                                              <xforms:setvalue ref="instance('local-data')/GeneratedPassword"

                                                                                                              value="concat(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1),

                                                                                                                            substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1))"/>

 

 

 

Do you know, if I can xform:setvalue from javascript ?

 

Best Regards,

 

 

De : Denis Galiana [mailto:[hidden email]]
Envoyé : jeudi 7 mai 2009 15:13
À : [hidden email]
Objet : [ops-users] XForms/XPath expressions in 'value' of xforms:setvalue; how to generate a random string (to be used as password)

 

Hi,

 

I’m trying to generate a random password string in a <xforms:setvalue> sentence.

Could anybody help me ?

 

Best regards,

Denis

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws