Re: First draft of template note

Alex Milowski <alex@milowski.org> writes:

> Although possibly less clear, we can remove the pipe binding for the
> source if we re-order the sibling steps:
>
> <p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
>             xmlns:c="http://www.w3.org/ns/xproc-step"
>             name="main" version="1.0">
> <p:option name="username" required="true"/>
> <p:option name="password" required="true"/>
>
> <p:document-template>
>   <p:input port="template">
>     <p:inline>
>       <c:request method="POST" href="{/doc/request/@uri}"
>                  username="{$username}" password="{$password}">
>         { /doc/request/node() }
>       </c:request>
>     </p:inline>
>   </p:input>
>   <p:input port="parameters">
>     <p:pipe step="vars" port="result"/>
>   </p:input>
> </p:document-template>
>
> <p:in-scope-names name="vars"/>
>
> </p:pipeline>

I think that's *A LOT* less clear.

> I wonder if this problem of ordering will arise quite frequently and
> make binding of the source always required.  If we made the parameters
> port the primary port, we could do this:
>
> <p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
>             xmlns:c="http://www.w3.org/ns/xproc-step"
>             name="main" version="1.0">
> <p:option name="username" required="true"/>
> <p:option name="password" required="true"/>
>
> <p:in-scope-names name="vars"/>
>
> <p:document-template>
>   <p:input port="template">
>     <p:inline>
>       <c:request method="POST" href="{/doc/request/@uri}"
>                  username="{$username}" password="{$password}">
>         { /doc/request/node() }
>       </c:request>
>     </p:inline>
>   </p:input>
>   <p:input port="source">
>     <p:pipe step="main" port="source"/>
>   </p:input>
> </p:document-template>

No, I don't think we could. I think that the primary nature of a
parameter input port is independent of the primary nature of a normal
input port.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
www.marklogic.com

Received on Sunday, 7 November 2010 18:11:56 UTC