W3C home > Mailing lists > Public > xproc-dev@w3.org > February 2012

XSLT-like command line parameter passing

From: Dr. Yves Forkl <Y.Forkl@srz.de>
Date: Fri, 24 Feb 2012 19:27:01 +0100
Message-ID: <4F47D675.40409@srz.de>
To: XProc Dev <xproc-dev@w3.org>
Please forgive if this is a trivial question, but I couldn't find an example of how to do this anywhere.

Very much like with XSLT, I would like to reference the value of a parameter that has been passed to the processor from the command line.

The command line part, of course, is easy with Calabash: --with-param myparam=myvalue

As far as I have understood, XProc has no global variables, but can pass parameters through its steps. However, I can't figure out how to access the parameter within an XPath expression when setting variable myvar in a step of my pipeline:

<p:declare-step name="main" type="srz:pipeline1"
  xmlns:p="http://www.w3.org/ns/xproc"
  xmlns:srz="http://xmlns.srz.de/yforkl/xproc"
  version="1.0">
  <p:input port="source"/>
  <p:output port="result" sequence="true"/>
  <p:input port="parameters" kind="parameter"/>

  ...

  <p:declare-step name="step3" type="srz:step3">
    <p:input port="source"/>
    <p:output port="result" sequence="true">
      <p:pipe step="store-each" port="result"/>
    </p:output>
    <p:input port="parameters" kind="parameter"/>

    ...

    <p:variable name="myvar" select="$myparam"/>

    ...

  </p:declare-step>

....
  <srz:step3/>

</p:declare-step>


Do I need to read out <c:param-set> and parse its <c:param> children? Or what else am I missing?

Yves
Received on Sunday, 26 February 2012 22:20:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 26 February 2012 22:20:04 GMT