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"
  <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:input port="parameters" kind="parameter"/>


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





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

Received on Sunday, 26 February 2012 22:20:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:02 UTC