W3C home > Mailing lists > Public > xproc-dev@w3.org > March 2009

parameters with my test runner

From: James Fuller <james.fuller.2007@gmail.com>
Date: Sun, 29 Mar 2009 13:12:19 +0200
Message-ID: <a0ad8ffe0903290412u5f001752w87d7beaaebaaf689@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>

I have a crude test runner which I use with my xproc impl:

<p:declare-step name="pipeline"

<p:input port="source" primary="true"/>

<p:input port="input-port" primary="false"
    <p:pipe step="pipeline" port="stdin"/>
<p:input port="output-port" primary="false"
    <p:pipe step="pipeline" port="stdin"/>
<p:input port="pipeline-port" primary="false" select="/t:test/t:pipeline/*">
    <p:pipe step="pipeline" port="stdin"/>

<p:output port="result" primary="true"/>

<ext:xproc name="test-pipeline">
    <p:input port="source" select="/">
        <p:pipe step="pipeline" port="input-port"/>
    <p:input port="pipeline" select="/">
        <p:pipe step="pipeline" port="pipeline-port"/>

    <p:input port="source">
        <p:pipe port="result" step="test-pipeline"/>
    <p:input port="alternate">
        <p:pipe port="output-port" step="pipeline"/>


Which will run an xproc defined test (http://tests.xproc.org/) and
check that the output matches expected output.

Two things to note is that my implementation (expressing impl freedom
;) ) of p:compare result port is primary (which will change).

The other is I have a ext:xproc which runs an xproc pipeline given an input.

Plenty of the tests in the test suite define multiple inputs which
reflect that some steps have multiple inputs (p:xslt for example).

I could choose to define ext:xproc with all known non primary inputs
but I would also have to define the corresponding top level inputs,
this approach is not really maintainable.

perhaps this is a good example for the use of parameters?

My ext:xproc would then bring in all the inputs (apart from primary)
in the same way as I do external bindings ... in any event, this
clarified the use case for parameters for me ... but I still find them
a little non intuitive.

as an aside, is the name 'parameters' reserved e.g. is this possible

  <p:input port="parameters" kind="document"/>

cheers, Jim Fuller
Received on Sunday, 29 March 2009 11:13:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:04 UTC