Hello, Is there any thing like arrays in xforms? Can I split the string and show the output with xforms
repeat. Thanks & Regards Prameela
R -- 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 |
standard xpath allows sequences, you can split a string using
xpath functions such as tokenize() ----------------------------------------------- Ryan Puddephatt Connectivity Developer Fidessa LatentZero 1 Old Jewry London EC2R 8DN Office: +44 (0) 20 7105 1000 Direct: +44 (0) 20 7105 1821 Blackberry: +44 (0) 79 8539
2458 Fax: +44 (0) 20 7105 1818 Email: [hidden email] From: Prameela R
[mailto:[hidden email]] Hello, Is
there any thing like arrays in xforms? Can
I split the string and show the output with xforms repeat. Thanks & Regards Prameela R
_______________________________________________________________________ The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. _____________________________________________________________________ This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com -- 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 |
Administrator
|
In reply to this post by Prameela R
As mentioned, XPath 2.0 has sequences, and you can split strings with
tokenize(). The only issue is that xforms:repeat only iterates over nodes, and it can't iterate over strings. So you can't just write <xforms:repeat nodeset="tokenize(...)">. Instead, you will have to: * create nodes into an instance, e.g. using xforms:insert * then point xforms:repeat to those nodes -Erik On Feb 23, 2009, at 1:28 AM, Prameela R wrote: > > Hello, > > Is there any thing like arrays in xforms? > Can I split the string and show the output with xforms repeat. > > > Thanks & Regards > Prameela R > > > -- > 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 Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- 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 |
In reply to this post by Ryan Puddephatt-3
Ryan, Thank you for the response. It did work. Prameela From: Ryan Puddephatt
[mailto:[hidden email]] standard xpath
allows sequences, you can split a string using xpath functions such as
tokenize() ----------------------------------------------- Ryan Puddephatt Connectivity Developer Fidessa LatentZero 1 Old Jewry Office: +44 (0) 20 7105 1000 Direct: +44 (0) 20 7105 1821 Blackberry: +44 (0) 79 8539 2458 Fax: +44 (0) 20 7105 1818 Email: [hidden email] From: Prameela R
[mailto: Hello, Is there any thing like arrays in xforms? Can I split the string and show the output with xforms
repeat. Thanks & Regards Prameela
R
-- 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 |
Hello Ryan, <xforms:output
value="string-join(for $i in tokenize(instance('cityvalues')/city, ',')
return string($i), '|')"> Can I set these values in repeat..?Bcz I have
to have different functionality for each and every string. Prameela. From: Prameela R
[mailto: Ryan, Thank you for the response. It did work. Prameela From: Ryan Puddephatt
[mailto:[hidden email]] standard xpath allows
sequences, you can split a string using xpath functions such as tokenize() ----------------------------------------------- Ryan Puddephatt Connectivity Developer Fidessa LatentZero 1 Old Jewry Office: +44 (0) 20 7105 1000 Direct: +44 (0) 20 7105 1821 Blackberry: +44 (0) 79 8539 2458 Fax: +44 (0) 20 7105 1818 Email: [hidden email] From: Prameela R [mailto: Hello, Is there any thing like arrays in xforms? Can I split the string and show the output with xforms
repeat. Thanks & Regards Prameela
R
-- 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 |
Administrator
|
On Feb 25, 2009, at 10:34 PM, Prameela R wrote:
> <xforms:output value="string-join(for $i in > > tokenize(instance('cityvalues')/city, ',') return > > string($i), '|')"> > > Can I set these values in repeat..?Bcz I have to have different > functionality for each and every string. > What do you mean by "set these values in repeat"? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
I.e. can I use the tokenized values in repeat similar to instance parsing?
For now, I used a JavaScript function to split and display those in xform.But it would be nice if we do it with xform itself. Prameela. -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Friday, February 27, 2009 1:38 AM To: [hidden email] Subject: [ops-users] Re: RE: RE: RE: Arrays in xforms On Feb 25, 2009, at 10:34 PM, Prameela R wrote: > <xforms:output value="string-join(for $i in > > tokenize(instance('cityvalues')/city, ',') return > > string($i), '|')"> > > Can I set these values in repeat..?Bcz I have to have different > functionality for each and every string. > What do you mean by "set these values in repeat"? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
Administrator
|
Prameela,
On Mar 1, 2009, at 9:16 PM, Prameela R wrote: > I.e. can I use the tokenized values in repeat similar to instance > parsing? > > For now, I used a JavaScript function to split and display those in > xform.But it would be nice if we do it with xform itself. If you have a sequence of strings, and want to iterate with an <xforms:repeat> on it, assuming the sequence in in $seq, you can do: <xforms:repeat nodeset="for $s in $seq return xxforms:element('text', $s)"> This gets your around the limitation of <xforms:repeat> wanting nodes by creating an element for each string in your sequence. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
Alex,
Thank you for your response. I tried with the following code where instance('cityvalues')/city has set of strings with delimiter ',' <xforms:repeat nodeset="for $v in tokenize(instance('cityvalues')/city,',') return xxforms:element('text', $v)"> <xforms:variable name="val" ref="."/> <xforms:setvalue ref="instance('listvalues')/value1" value="."/> <a href="http://localhost:8080/web/guest/home?p_p_id=organizeby_WAR_organizeby& amp;p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=co lumn-1&p_p_col_count=1&_organizeby_WAR_organizeby_eventid={$val}.xml &_organizeby_WAR_organizeby_oxf.path=%2Fportlet-welcome%2Fshowdetails.xh tml"><xforms:output ref="."/></a> </xforms:repeat> It gives no errors but when I try to print variable value, it gives empty.Even no value is set into the instance. If I use this <xforms:output ref="."/> in repeat there is no problem, iam able to print it. But I need it in anchor tag. I think I can manage it using substring function as repeat function works. If there is a solution other than with substring , please do send. Prameela. -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Thursday, March 05, 2009 7:33 AM To: [hidden email] Subject: [ops-users] Re: RE: Re: RE: RE: RE: Arrays in xforms Prameela, On Mar 1, 2009, at 9:16 PM, Prameela R wrote: > I.e. can I use the tokenized values in repeat similar to instance > parsing? > > For now, I used a JavaScript function to split and display those in > xform.But it would be nice if we do it with xform itself. If you have a sequence of strings, and want to iterate with an <xforms:repeat> on it, assuming the sequence in in $seq, you can do: <xforms:repeat nodeset="for $s in $seq return xxforms:element('text', $s)"> This gets your around the limitation of <xforms:repeat> wanting nodes by creating an element for each string in your sequence. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
Administrator
|
Prameela,
The <xforms:setvalue> above, inside the <xforms:repeat> isn't doing anything. Actions must listen to an event, and they will run when that event is dispatched to their parent element. Even if your code is working, you might want to remove that <xforms:setvalue> just to prevent people reading this code from getting confused. Alex |
Free forum by Nabble | Edit this page |