Re: p:with-input and compound steps

2./5.: If it's important to be aligned with XProc 1.0, then "current" would
be the primary input port in a p:for-each. But I guess that's a bit awkward
when used in a p:with-input.


An idea for syntactic sugar for p:with-input (not sure if it's worth it, I
just thought of it and thought I'd suggest it):

<p:declare-step type="ex:foo" xmlns:p="http://www.w3.org/ns/xproc"
*xmlns:with="http://www.w3.org/ns/xproc/with
<http://www.w3.org/ns/xproc/with>"*>
    <p:input port="source"/>
    …
  </p:declare-step>

  <ex:foo>
    *<with:source>*...


Alternatively xmlns:port="http://www.w3.org/ns/xproc/port" and
<port:source>.

Could also work for options if option names were NCNames instead of QNames
(are QNames really used for option names anyway?): *<with:href
select="..."/>*

Regards
Jostein

On 23 September 2017 at 10:22, Norman Walsh <ndw@nwalsh.com> wrote:

> Hello all,
>
> We’ve decided to try p:with-input to distinguish input declaration
> from input connections:
>
>   <p:declare-step type="ex:foo">
>     <p:input port="source"/>
>     …
>   </p:declare-step>
>
>   <ex:foo>
>     <p:with-input port="source">…
>
> We also, separately, decided to abandon p:iteration-source and
> p:viewport-source.
>
> So…is the input to p:for-each defining an input with either a name (an
> arbitrary name?) or no name, or is it connecting something to an input
> with either a name (an arbitrary name?) or no name?
>
> 1. <p:for-each>
>      <p:input>…</p:input>
>
> 2. <p:for-each>
>      <p:input name="source">…</p:input>
>
> 3. <p:for-each>
>      <p:input name="anythingIwant">…</p:input>
>
> 4. <p:for-each>
>      <p:with-input>…</p:with-input>
>
> 5. <p:for-each>
>      <p:with-input name="source">…</p:with-input>
>
> 6. <p:for-each>
>      <p:with-input name="anythingIwant">…</p:with-input>
>
> I think it’s probably easier to explain as p:with-input, so I think I
> favor 4, 5, and 6 over 1, 2, and 3. I don’t think option 6 makes any
> sense.
>
> Option 4 is appealing because there can be only one input and its name
> is irrelevant. But it introduces a new class of with-input tag: an
> anonymous one. Is the small savings in typing worth the cognative load
> of a new kind of thing?
>
> Option 5 is therefore the simplest and most consistent thing, I think.
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh
> Lead Engineer
> MarkLogic Corporation
> Phone: +1 512 761 6676
> www.marklogic.com
>

Received on Monday, 25 September 2017 09:43:10 UTC