-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option with name "temp-dir" overrides temp-dir variable #44
Comments
I've had the same problem. Hmm, I thought this was fixed in #4 but it seems not Some testing suggests that this is how calabash handles subsequent <?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:px="#" version="1.0">
<p:serialization port="result" indent="true"/>
<p:output port="result"/>
<p:variable name="temp-dir" select="'original temp-dir'"/>
<p:declare-step type="px:substep">
<p:output port="result"/>
<p:option name="temp-dir" select="'new temp-dir'"/>
<p:option name="output-dir" select="$temp-dir"/>
<p:in-scope-names name="in-scope-names"/>
<p:identity>
<p:input port="source">
<p:pipe port="result" step="in-scope-names"/>
</p:input>
</p:identity>
</p:declare-step>
<px:substep/>
</p:declare-step> Output: <c:param-set xmlns:c="http://www.w3.org/ns/xproc-step">
<c:param name="output-dir" namespace="" value="original temp-dir"/>
<c:param name="temp-dir" namespace="" value="new temp-dir"/>
</c:param-set> So the simplest solution maybe is to say that this is just how it's supposed to behave? Maybe display a warning if Alternatively I could implement a workaround by resolving all the options prior to inserting them into the |
Oh, #4 is exactly the same issue, yes. I am using v1.1.0. It looks to me like your test isn't really testing the issue. You could say that this is just how it's supposed to behave, although it's a side effect of the current implementation. The specification doesn't give anything away about temp-dir being an option and I like that. Another solution could be to replace the "$temp-dir" variable for the "param" and "option" elements with a "base-uri" attribute like on the "document" element. Don't know if that makes a difference at all? |
<x:option name="brf-output-dir" select="concat($temp-dir,'output-dir/foo/')"/> would become: <x:option name="brf-output-dir" select="resolve-uri('output-dir/foo/')" base-uri="temp-dir"/> |
The context for the xpath expressions are set to a document with an xml:base pointing to the xprocspec document, so that resolve-uri resolves relative to the xprocspec document. For instance, this should resolve properly: <x:option name="option-name" select="resolve-uri('../resources/book.xml')"> So a <p:with-option name="option-name" select="resolve-uri('../resources/book.xml')">
<p:inline>
<context xml:base="file:/home/jostein/daisy-pipeline/pipeline-modules/xprocspec/xprocspec/src/test/xprocspec/tests/document-3.resources/document-3.xprocspec.skip-ci"/>
</p:inline>
</p:with-option> I could set the |
OK, that could work (I think). What about the suggestion with the |
Ah, I see what you mean now. Sorry I missed that part. Yeah, I guess that would work. Seems cleaner indeed. 👍 |
See also the documentation of |
Not sure if this is a bug or a feature, but because of it I can't define an option named "temp-dir" before another option that uses "$temp-dir". To be able to define one before the other is important if you want to use nested scenarios.
For example:
It does work if I just do:
A workaround (but not really what I want) is to set the temp-dir option to "$temp-dir":
The text was updated successfully, but these errors were encountered: