Re: primary ports and automatic connections

James,

On Thu, Sep 18, 2008 at 1:30 AM, James Garriss <james@garriss.org> wrote:

>  from:  2:3 Primary Inputs and Outputs
>
> "The special significance of primary input and output ports is that they
> are connected automatically by the processor if no explicit binding is
> given."
>
> Is it valid to assume then that if an input port is not a primary port, it
> is not automatically connected by the processor?
>

Sure !


>
>
> I ask because when I run this pipeline in Calabash 0.6.0:
>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
>     <p:input port="source">
>         <p:inline><foo>bar</foo></p:inline>
>     </p:input>
>     <p:output port="result"/>
>     <p:identity/>
> </p:declare-step>
>
> I get this output:
>
> <foo xmlns:p="http://www.w3.org/ns/xproc">bar</foo<http://www.w3.org/ns/xproc%22%3Ebar%3C/foo>
> >
>
> This puzzles me, because identity has no primary ports:
>
> <p:declare-step type="p:identity">
>      <p:input port="source" sequence="true"/>
>      <p:output port="result" sequence="true"/>
> </p:declare-step>
>

Of course there is a primary input AND a primary output port
If you look at the definition of primary input port

[Definition: If a step has a document input port which is explicitly marked
"primary='true'", or if it has exactly one document input port and that port
is *not* explicitly marked "primary='false'", then that input port is
the *primary
input port* of the step]

you can see that

[[
or if it has exactly one document input port and that port is *not* explicitly
marked "primary='false'",
]]

which is exaclty the case for p:identity and a bunch of other steps

Xmlizer

Received on Thursday, 18 September 2008 03:30:18 UTC