Re: Re: for-each loop issue in xforms.

Posted by HankRatz on
URL: https://discuss.orbeon.com/for-each-loop-issue-in-xforms-tp1472983p1473101.html


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