Arrays in xforms

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Arrays in xforms

Prameela R

 

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
Reply | Threaded
Open this post in threaded view
|

RE: Arrays in xforms

Ryan Puddephatt-3

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]

Web: http://www.latentzero.com

 

From: Prameela R [mailto:[hidden email]]
Sent: 23 February 2009 09:29
To: [hidden email]
Subject: [ops-users] Arrays in xforms

 

 

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

 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


_______________________________________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Arrays in xforms

Erik Bruchez
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
Reply | Threaded
Open this post in threaded view
|

RE: RE: Arrays in xforms

Prameela R
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]]
Sent: Monday, February 23, 2009 3:22 PM
To: [hidden email]
Subject: [ops-users] RE: Arrays in xforms

 

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]

Web: http://www.latentzero.com

 

From: Prameela R [mailto:[hidden email]]
Sent: 23 February 2009 09:29
To: [hidden email]
Subject: [ops-users] Arrays in xforms

 

 

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

 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


_______________________________________________________________________
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
Reply | Threaded
Open this post in threaded view
|

RE: RE: RE: Arrays in xforms

Prameela R

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:[hidden email]]
Sent: Tuesday, February 24, 2009 4:42 PM
To: [hidden email]
Subject: [ops-users] RE: RE: Arrays in xforms

 

Ryan,

 

Thank you for the response. It did work.

 

Prameela


From: Ryan Puddephatt [mailto:[hidden email]]
Sent: Monday, February 23, 2009 3:22 PM
To: [hidden email]
Subject: [ops-users] RE: Arrays in xforms

 

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]

Web: http://www.latentzero.com

 

From: Prameela R [mailto:[hidden email]]
Sent: 23 February 2009 09:29
To: [hidden email]
Subject: [ops-users] Arrays in xforms

 

 

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

 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


_______________________________________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: RE: RE: RE: Arrays in xforms

Alessandro Vernet
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
Reply | Threaded
Open this post in threaded view
|

RE: Re: RE: RE: RE: Arrays in xforms

Prameela R
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
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: RE: RE: RE: Arrays in xforms

Alessandro Vernet
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
Reply | Threaded
Open this post in threaded view
|

RE: Re: RE: Re: RE: RE: RE: Arrays in xforms

Prameela R
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&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=co
lumn-1&amp;p_p_col_count=1&amp;_organizeby_WAR_organizeby_eventid={$val}.xml
&amp;_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
Reply | Threaded
Open this post in threaded view
|

RE: Re: RE: Re: RE: RE: RE: Arrays in xforms

Alessandro Vernet
Administrator
Prameela,

Prameela R wrote
<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="."/>
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