W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > August 2007

Re: a column major packing component

From: Innovimax SARL <innovimax@gmail.com>
Date: Wed, 8 Aug 2007 18:51:33 +0200
Message-ID: <546c6c1c0708080951g7aca6916o2857f5e55b867af3@mail.gmail.com>
To: "Norman Walsh" <ndw@nwalsh.com>
Cc: public-xml-processing-model-wg@w3.org

On 8/8/07, Norman Walsh <ndw@nwalsh.com> wrote:
> / Innovimax SARL <innovimax@gmail.com> was heard to say:
> | I proposed last week a p:pack component to get any number of sequence
> | and put it in a column major way
> | say each letter represent a document of a sequence
> |                           .----------.
> | -- A - B - C - D --  |           |
> | -- E - F - G - H --  | PACK | -- <_>A E K</_> - <_>B F L</_> - <_>C G
> | M</_> - <_>D H N</_>
> | -- K - L - M - N --  |           |
> |                           .----------.
> |
> | It seems that I forgot that we loose "en passant" the possibility to
> | have "*" input ports
> |
> | So I propose this component with only two sequences as input
> |
> | <p:declare-step type="p:pack">
> |     <p:input port="source" sequence="yes" primary="yes"/>
> |     <p:input port="alternate" sequence="yes"/>
> |     <p:output port="result" sequence="yes"/>
> |     <p:option name="wrapper" required="yes"/>
> | </p:declare-step>
>
> Assuming that source comes from
>
>   <p:pipe step="srcseq" port="result"/>
>
> and alternate comes from
>
>   <p:pipe step="altseq" port="result"/>
>
> then p:pack is equivalent to the following for-each, yes?
>
>   <p:for-each name="packer">
>     <p:iteration-source>
>       <p:pipe port="srcseq" port="result"/>
>     </p:iteration-source>
>
>     <p:option name="count" select="p:iteration-position()"/>
>
>     <p:split-sequence name="getalt">
>       <p:input port="source">
>         <p:pipe step="altseq" port="result"/>
>       </p:input>
>       <p:option name="test" select="concat('position() = ',$count)"/>
>     </p:split-sequence>
>
>     <p:wrap wrapper="wrapper">
>       <p:input port="source">
>         <p:pipe step="packer" port="current"/>
>         <p:pipe step="getalt" port="matched"/>
>       </p:input>
>     </p:wrap>
>   </p:for-each>
>
> I grant that it might be faster for a single atomic step to do this,
> but I'm not sure it needs to be a standard step.
>

Not exactly

You miss the case where the srcseq is shorter thant the altseq

So I think it is just overcomplicated the way you want to do it (and
terribly inefficient)

Mohamed

-- 
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, 8 August 2007 16:51:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:53 GMT