Re: a component with * inputs

With say 3 sequence as input

To simplify, we say that they are of the same size (we will explain
what to do when they aren't) and this size is ''k''

seq1 --- D1,k -- D1,k-1 -- .....-- D1,3 -- D1,2 -- D1,1 ---
seq2 --- D2,k -- D2,k-1 -- .....-- D2,3 -- D2,2 -- D2,1 ---
seq3 --- D3,k -- D3,k-1 -- .....-- D3,3 -- D3,2 -- D3,1 ---

the output would be one sequence

result--- Rk -- Rk-1 -- .....-- R3 -- R2 -- R1

where for each ''i'' from 1 to ''k'',
Ri is composed this way
<wrapper>
  <D1,{i}>...</D1,{i}>
  <D2,{i}>...</D2,{i}>
  <D3,{i}>...</D3,{i}>
</wrapper>

For the case where the sequence are not from the same size

1) we could say it is an error (I prefer it to depend on a option)
2) we could say, it just make a compose with less docs)

Hope this helps

Mohamed





On 8/1/07, Norman Walsh <ndw@nwalsh.com> wrote:
> / Innovimax SARL <innovimax@gmail.com> was heard to say:
> | When I was re reading the answer of Norm to my demand for a
> | p:equal-sequence (which was do-it-with-for-each !), I suddently see
> | that we cannot do that efficiently in for-each
> | And moreover that's a task that is useful
> |
> | I propose to add a p:pack (not so sure about the name)
> |
> | <p:declare-step type="p:pack">
> |      <p:input port="*" sequence="yes"/>
> |      <p:output port="result" sequence="yes"/>
> |      <p:option name="wrapper" required="yes"/>
> | </p:declare-step>
> |
> | What it does is simple
> |
> | It takes p sequence (seq_1,....seq_p) of respective length (len_1, ....len_p)
> |
> | It outputs a sequence of length max(len_1, ...len_p)
> | and for each position of doc of the result sequence
> | we have
> | result_1 (wrap(seq_1(i), .....seq_p(i))
> |
> | Where seq_k(i) is non empty if k <= len_k
> |
> | I was thinking to give a special component that can distribute
> | multiple flows at the same time, but the fact is that we that
> | component and for-each, you can do it as efficiently
> |
> | I ask it for beeing a required step (since it's not difficult to implement)
>
> Can you give an example? I'm afraid I can't quite figure out what this
> step does.
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | Two starving men cannot be twice as
> http://nwalsh.com/            | hungry as one; but two rascals can be
>                               | ten times as vicious as one.--George
>                               | Bernard Shaw
>
>


-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Wednesday, 1 August 2007 15:25:40 UTC