Re: First draft of template note

On Sun, Nov 7, 2010 at 1:02 PM, Norman Walsh <ndw@nwalsh.com> wrote:
> The transatlantic edit:
>
>  http://www.w3.org/XML/XProc/docs/template-note

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 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>

</p:pipeline>


-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Sunday, 7 November 2010 16:03:30 UTC