W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > November 2009

p:output and connections

From: Vasil Rangelov <boen.robot@gmail.com>
Date: Sat, 7 Nov 2009 00:46:03 +0200
To: <public-xml-processing-model-comments@w3.org>
Message-ID: <4af4a737.09135e0a.0a5d.14cf@mx.google.com>
Latest editor's draft, 3 November 2009

1) 5.4 p:output says

"It is a static error (err:XS0029) to specify a connection for a p:output
inside a p:declare-step for an atomic step."

How is a step supposed to produce an output then? Especially one where the
result comes from a non-primary port of a step, or where it comes from the
primary output port of a step other than the latest one. Consider the very
first example:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                name="xinclude-and-validate"
                version="1.0">
  <p:input port="source" primary="true"/>
  <p:input port="schemas" sequence="true"/>
  <p:output port="result">
    <p:pipe step="validated" port="result"/>
  </p:output>

  <p:xinclude name="included">
    <p:input port="source">
      <p:pipe step="xinclude-and-validate" port="source"/>
    </p:input>
  </p:xinclude>

  <p:validate-with-xml-schema name="validated">
    <p:input port="source">
      <p:pipe step="included" port="result"/>
    </p:input>
    <p:input port="schema">
      <p:pipe step="xinclude-and-validate" port="schemas"/>
    </p:input>
  </p:validate-with-xml-schema>
</p:declare-step>

Doesn't the above sentence mean this creates a static error? Or am I wrong
in assuming that "connection" is equivalent to "binding"?

2) What happens if a connection is provided upon a call to an atomic step?
Is this a static error, and if not, does the connection get used if the
returned output is empty (and/or simply not populated by the step), or does
it completely abolish whatever the step may have produced on that port?

In other words, what happens if I have, say:

<p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"
name="pipeline">
  <p:xslt>
    <p:input port="stylesheet">
      <p:document href="stylesheet.xsl"/>
    </p:input>
    <p:with-option name="version" value="2.0"/>
    <p:output port="secondary">
      <p:pipe step="pipeline" port="source"/>
    </p:output>
  </p:xslt>
</p:pipeline>

Personally, I think this should either be explicitly stated as a static
error OR be used as a *default* connection in case the step produces an
empty sequence on that port. In the case of the above example, it could mean
that the source document will be provided on the secondary port if the
stylesheet didn't produced a second document, but if the stylesheet did
produced one or more secondary documents, they'll be seen there.

3) Is p:empty the default connection for the non-primary outputs of steps? I
assume yes, but that doesn't seem to be clarified. An acceptable
alternative, I think, is to disallow non-primary outputs in step
declarations without a connection of some kind (completely in contrast with
the 5.4 sentence at the start).

Regards,
Vasil Rangelov
Received on Friday, 6 November 2009 22:46:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 6 November 2009 22:46:55 GMT