Multiple inputs to an XPL processor

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

Multiple inputs to an XPL processor

Vancheri, Alessandro

If a p:processor has multiple p:input, how do I refence in an xpath expression the referenced source input?

Many thanks.

 

Alessandro

 



--
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: Multiple inputs to an XPL processor

Steve Bayliss
Message
If, for example, you have an input named "custom", you would reference it something like
 
document('input:custom')/some/xpath/expression
 
Steve
-----Original Message-----
From: Vancheri, Alessandro [mailto:[hidden email]]
Sent: 04 December 2008 13:04
To: [hidden email]
Subject: [ops-users] Multiple inputs to an XPL processor

If a p:processor has multiple p:input, how do I refence in an xpath expression the referenced source input?

Many thanks.

 

Alessandro

 



--
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: Multiple inputs to an XPL processor

fl.schmitt(ops-users)
In reply to this post by Vancheri, Alessandro
Alessandro,

> If a p:processor has multiple p:input, how do I refence in an xpath
> expression the referenced source input?

i suppose you're talking about the xslt processor? Regarding that
processor, there's an example in the documentation:

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

In short: if your custom input has the name "my-input", you can access
it with "doc('input:my-input')".

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: Multiple inputs to an XPL processor

Vancheri, Alessandro
Is it possible to use an other input in a p:choose? I have to test the input in the href of the p:choose against an other input. Perhaps do I have to aggregate the two inputs in a single document passed by href?

-----Original Message-----
From: Florian Schmitt [mailto:[hidden email]]
Sent: giovedì 4 dicembre 2008 14.50
To: [hidden email]
Subject: [ops-users] Re: Multiple inputs to an XPL processor

Alessandro,

> If a p:processor has multiple p:input, how do I refence in an xpath
> expression the referenced source input?

i suppose you're talking about the xslt processor? Regarding that processor, there's an example in the documentation:

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

In short: if your custom input has the name "my-input", you can access it with "doc('input:my-input')".

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: Re: Multiple inputs to an XPL processor

fl.schmitt(ops-users)
Alessandro,

> Is it possible to use an other input in a p:choose? I have to test
> the input in the href of the p:choose against an other input. Perhaps
> do I have to aggregate the two inputs in a single document passed by
> href?

i think this will work, too. But it will make the XPath in the
p:when/@test more complex, and the comparison of the two inputs has to
be inserted in every p:when branch. Maybe it's clearer to separate the
comparison of the two inputs from the p:choose branches and to put it
into a xslt transformation. Using user-defined inputs, you could
aggregate the inputs, and put the comparison logic in one (and the same)
place (maybe a xslt variable). Using the xslt processor has the
additional advantage of better and centralized debugging possibilities.

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
|

R: Re: RE: Re: Multiple inputs to an XPL processor

Vancheri, Alessandro
I implemented your suggestion. But now I have a new problem. In the pipeline I have a choose followed by a for-each. The choose has a when clause to be executed only at the first iteration of the for-each. The evaluation of the test is based on the output of an other processor, Unfortunately the processor which feeds the test of the choose seems executed only at the first iteration. So the choose test condition is always true. Perhaps do I have to move the choose inside the for-each?

-----Messaggio originale-----
Da: Florian Schmitt [mailto:[hidden email]]
Inviato: giovedì 4 dicembre 2008 17.45
A: [hidden email]
Oggetto: [ops-users] Re: RE: Re: Multiple inputs to an XPL processor

Alessandro,

> Is it possible to use an other input in a p:choose? I have to test the
> input in the href of the p:choose against an other input. Perhaps do I
> have to aggregate the two inputs in a single document passed by href?

i think this will work, too. But it will make the XPath in the p:when/@test more complex, and the comparison of the two inputs has to be inserted in every p:when branch. Maybe it's clearer to separate the comparison of the two inputs from the p:choose branches and to put it into a xslt transformation. Using user-defined inputs, you could aggregate the inputs, and put the comparison logic in one (and the same) place (maybe a xslt variable). Using the xslt processor has the additional advantage of better and centralized debugging possibilities.

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: R: Re: RE: Re: Multiple inputs to an XPL processor

fl.schmitt(ops-users)
Alessandro,

> I implemented your suggestion. But now I have a new problem. In the
> pipeline I have a choose followed by a for-each. The choose has a
> when clause to be executed only at the first iteration of the
> for-each. The evaluation of the test is based on the output of an
> other processor, Unfortunately the processor which feeds the test of
> the choose seems executed only at the first iteration. So the choose
> test condition is always true. Perhaps do I have to move the choose
> inside the for-each?

i'm sorry, but i'm not sure wether i understood the structure of your
XPL correctly. It seems like

<p:choose href="#instance">
    <p:for-each href="#instance"
            select="repeatingElement"
            root="newRoot"
            id="for-each-out">
        <p:when test="firstIteration AND conditionOnOutput">...</p:when>
        <p:when test="conditionOnOutput">...</p:when>
        <p:when test="conditionOnOutput">...</p:when>
    </p:for-each>
</p:choose>

I've never worked with a XPL structure like this, but i think the
for-each has to be in fact the outermost element. Maybe you could post
the complete XPL?

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