for-each loop issue in xforms.

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

for-each loop issue in xforms.

Laxmi Narayana-3

Hi All,
 
By defalut xsl:for-each  taking data from main-instance in my xforms.I want to take data from template-instance.
 
If i write for-each loop like below, it thorws a exception.
 
 <xsl:for-each select="instance('template-instance')//records/record">
<xsl:for-each>
 
How to write for-each which gets data from template-instance?
Pl help me.

        
 


--
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: for-each loop issue in xforms.

fl.schmitt(ops-users)
Hi Laxmi,

> By defalut *xsl:for-each*  taking data from *main-instance* in my
> xforms.I want to take data from *template-instance*.
>  
> If i write for-each loop like below, it thorws a exception.
>  
>  <xsl:for-each select="*instance('template-instance')//*records/record">
> <xsl:for-each>
>  
> How to write for-each which gets data from template-instance?
> Pl help me.
i think you can't access the model using instance() because xslt is
processed before the xforms engine takes over the document. If this is
correct, you still have different options:

- preprocess your template-instance as needed;
- aggregate your instances to a single instance so xslt can access it;
- keep your template-instance and use xforms and repeat to iterate over
the nodeset.

HTH
florian



--
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: for-each loop issue in xforms.

HankRatz

On Feb 8, 2010, at 8:12 AM, Florian Schmitt wrote:

> Hi Laxmi,
>
>> By defalut *xsl:for-each*  taking data from *main-instance* in my
>> xforms.I want to take data from *template-instance*.
>>
>> If i write for-each loop like below, it thorws a exception.
>>
>> <xsl:for-each select="*instance('template-instance')//*records/record">
>> <xsl:for-each>
>>
>> How to write for-each which gets data from template-instance?
>> Pl help me.
>
> i think you can't access the model using instance() because xslt is
> processed before the xforms engine takes over the document. If this is
> correct, you still have different options:
>
> - preprocess your template-instance as needed;
> - aggregate your instances to a single instance so xslt can access it;
> - keep your template-instance and use xforms and repeat to iterate over
> the nodeset.
Florian is correct. I would like to add, that you can access variables in XSLT -- you
can define multiple inputs, which are accessed as separated variables --
an alternative to aggregating the instances:

http://www.orbeon.com/orbeon/doc/processors-xslt#user-defined

Cheers,
Hank

>
> HTH
> florian
>
>
> --
> 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
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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: for-each loop issue in xforms.

Erik Bruchez-3
In reply to this post by Laxmi Narayana-3
Laxmi,

From XForms, you should instead use xforms:repeat.

-Erik

On Mon, Feb 8, 2010 at 6:44 AM, Laxmi Narayana <[hidden email]> wrote:

>
> Hi All,
>
> By defalut xsl:for-each  taking data from main-instance in my xforms.I want
> to take data from template-instance.
>
> If i write for-each loop like below, it thorws a exception.
>
>  <xsl:for-each select="instance('template-instance')//records/record">
> <xsl:for-each>
>
> How to write for-each which gets data from template-instance?
> Pl help me.
>
>
>
> --
> 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
>
>


--
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