- From: Dave Pawson <dave.pawson@gmail.com>
- Date: Mon, 25 May 2009 08:30:21 +0100
- To: xproc-dev@w3.org
Thanks Vojtech. 2009/5/25 <Toman_Vojtech@emc.com>: > For example, consider this params.xml document: > > <c:param-set xmlns:c='http://www.w3.org/ns/xproc-step'> > <c:param name='testname1' value='testvalue1'/> > <c:param name='testname2' namespace="http://foo.bar" > value='testvalue2'/> > </c:param-set> OK so it does stand alone with c:param-set as the root element. Thanks. <grin/> Now can I 'build' on them, as Apache ant does? <c:param name='testname1' value='testvalue1'/> <c:param name='testname2' value='${testname1}/dir/dir/file.ext'/> > > > You can then pass it to the parameter input port of this pipeline: Singular? I.e. there is only one parameter input port? Implies I can't have multiple 'imported' variable definitions? My use case was 1 file for common values (paths etc) 1 file for 'hidden' items, e.g. user names, passwords etc. I think you provide the answer below. > > <p:declare-step name="main" xmlns:p="http://www.w3.org/ns/xproc"> > <p:input port="parameters" kind="parameter"/> > <p:output port="result" sequence="true"/> > > <p:parameters name="parameters"> > <p:input port="parameters"> > <p:pipe step="main" port="parameters"/> > </p:input> > </p:parameters> Is the input port 'parameters' the only link between the step and the param-set? Why no <c:param-set name="param1" xmlns:c='http://www.w3.org/ns/xproc-step'> or an href on the step that calls up the param-set? (I guess we are 'abusing' the idea of parameters by treating them like variables as per xslt) > > <!-- "result" is not primary on p:parameters --> > <p:identity> > <p:input port="source"> > <p:pipe step="parameters" port="result"/> > </p:input> > </p:identity> > </p:declare-step> Guessing, this is simply copying the param-set to the output port? > > > Or, you can read it in the pipeline using the p:document binding: > > <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"> > <p:output port="result" sequence="true"/> > > <p:parameters name="parameters"> > <p:input port="parameters"> > <p:document href="params.xml"/> > </p:input> > </p:parameters> Ah! That's what I wanted! So this refers to an explicit (external) parameters file! Next question, how do I refer to the values set in the external file? Is there some syntax for this? E.g. I want to run an XSLT transform using parameter $xslt_stylesheet as the stylesheet for the transform. > An interesting thing about parameters in XProc is that if you provide > the same parameter multiple times, only the last value will be used. You > could use this mechanism for overriding the previous > (default/inherited/...) parameter value if you want: Neat. Same principle as XSLT? Thanks. Seems I still have more questions than answers Vojtech! I do wish I could 'read' W3C specs (and understand them) regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk
Received on Monday, 25 May 2009 07:41:17 UTC