Re: Transforming the c:param-set document from the parameters port

Thanks, that helped me understand my options. Here's what I've ended up 
doing. In the example, I pass in gen.summary.tables as 0, but want that 
to be 'false', and pass in an empty foo and want all empty params to be 
omitted. A simple fixup-params-xslt does that work:

https://gist.github.com/dwcramer/9b892924f154f56db777187647776f47

I have a neurotic need to have a clean-and-simple outermost pipeline. To 
manipulate the params ahead of time, I can't really have a clean 
outermost pipeline, but I can move the simple-clean pipeline into a 
step, which I've called "my-main-pipeline" in the example.

I'm ok with this--I can nest my dolls in just this way and at least have 
a simple declaration of what I want to accomplish somewhere :-)

If it's a common enough situation, some syntactic sugar might be in 
order in xproc 3.0.

Thanks!
David

On 10/15/17 8:21 AM, Imsieke, Gerrit, le-tex wrote:
> Hi David,
>
> I’m not sure whether I understood the issue at hand. Anyway, I created 
> this gist: 
> https://gist.github.com/gimsieke/f3b5534658b2f7240d579230ca17fc4a
>
> If you invoke it like (assuming you have a front-end script called 
> calabash.sh):
>
> calabash.sh -p foo=bar -p other-param=other-val 
> test-param-manipulation.xpl
>
> the transformed parameters will be stored as manipulated-params.xml 
> and look like this:
>
> <c:param-set xmlns:c="http://www.w3.org/ns/xproc-step">
>    <c:param name="param" value="param"/>
>    <c:param name="foo" namespace="" value="baz"/>
> </c:param-set>
>
> The output will be like:
>
> <out xmlns:xs="http://www.w3.org/2001/XMLSchema"
>      xmlns:c="http://www.w3.org/ns/xproc-step">
>    <param name="foo" value="baz"/>
>    <param name="other-param" value=""/>
>    <param name="param" value="param"/>
> </out>
>
> Does looking at the pipeline answer your questions? If not, I’ll be 
> back in approx. 2 hours to answer more.
>
> Gerrit
>
>
> On 15.10.2017 06:22, David Cramer wrote:
>> The wonderful thing about posting to a mailing list is that it so 
>> often inspires you to see the obvious solution immediately /after/ 
>> you hit Send. Occasionally, the act of composing the message inspires 
>> me to see the solution before I hit Send, but not this time.
>>
>> Obviously, I just need to explicitly declare the result of my 
>> transformation as the input for the parameters port for any 
>> subsequent xslt steps or their wrappers:
>>
>>       <p:xslt>
>>          <p:input port="parameters" kind="parameter">
>>              <p:pipe port="result" step="param-fixup"/>
>>          </p:input>
>> ...
>>
>> I'd been trying to do that for p:group, but only a step can have a 
>> parameters port.
>>
>> Regards,
>> David
>>
>> On 10/14/17 11:03 PM, David Cramer wrote:
>>> Some time ago, I learned on this list how to fetch values from the 
>>> c:param-set that comes in on the parameter port to use in p:variable 
>>> values in my pipeline: 
>>> https://lists.w3.org/Archives/Public/xproc-dev/2012May/0005.html
>>>
>>> Now I'm attempting to transform that c:param-set before my xslt 
>>> steps consume it. Transforming the c:param-set is easy enough by 
>>> taking as input the result of the Geert Josten's ut:parameters 
>>> utility step: 
>>> https://github.com/grtjn/xproc-ebook-conv/blob/master/src/nl/grtjn/xproc/util/utils.xpl#L374
>>>
>>> However, once the c:param-set is transformed, I haven't figured out 
>>> how to make subsequent steps in the pipline use the manipulated 
>>> version.
>>>
>>> I could manipulate the parameters in the scripts that call calabash 
>>> or in the xslts, but it feels like I should be able to run the 
>>> c:param-set thorough an xslt and then use the result of that in the 
>>> rest of my pipline.
>>>
>>> Is this possible?
>>>
>>> Btw., I'm running xmlcalabash-1.1.16-97
>>>
>>> Regards,
>>> David
>>>
>>>
>>
>

Received on Sunday, 15 October 2017 19:32:37 UTC