Scott,

There are no built-in loops in XPL at the moment, but this is a
language construct that we have been thinking about integrating for a
long time. You are right about the problems of your workaround (in
addition it is not very efficient), but there is unfortunately no
better way until p:for-each is implemented.

-Erik

Scott McMullan wrote:

> I know how to branch with a <p:choose> in XPL, but how to loop?
>
> For example, I have a pipeline that receives the following input:
>
> <ActionList>
>            <Action docid="00001">approve</Action>
>            <Action docid="00002">reject</Action>
>            <Action docid="00078">return</Action>
> </ActionList>
>
> In my pipeline, I would like to be able to process this input document by
> looping over <Action> elements, for example:
>
> <p:for-each select="Action">
>
> Right now, the only way we can think to accomplish this is to use XSLT to do
> loop unrolling.  In other words, pass the <ActionList> document to an XSLT,
> unroll the loop by calling <xsl:for-each select="Action"> and dynamically
> constructing the appropriate XPL code to handle each <Action>, and then
> taking the XSLT output (which is a newly constructed pipeline) and feeding
> that to a <p:processor uri="oxf/processor/pipeline">.
>
> This seems very cumbersome and verbose -- is there a facility or better
> practice for looping in XPL?
>
> Thanks.
>
> -Scott
> http://cde.berkeley.edu/
> UC Berkeley Center for Document Engineering

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to