{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","user":{"avatar_url":"https://secure.gravatar.com/avatar/30607760e41ef676103479754e03c99a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"30607760e41ef676103479754e03c99a","url":"https://api.github.com/users/mkraetke","login":"mkraetke","id":983392},"milestone":null,"assignee":null,"updated_at":"2011-10-27T15:19:45Z","labels":[],"comments":8,"closed_at":"2011-09-29T13:30:59Z","url":"https://api.github.com/repos/ndw/xmlcalabash1/issues/9","body":"The issue relates to the assignment of arguments to p:exec steps. I want to implement jing with p:exec, because the p:validate-with-relax-ng step is useless to me without report port and readable output. Here is my pipeline:\r\n\r\n```\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<p:declare-step \r\n    xmlns:p=\"http://www.w3.org/ns/xproc\"\r\n    xmlns:c=\"http://www.w3.org/ns/xproc-step\"\r\n    version=\"1.0\">\r\n    <p:option name=\"input\"/>\r\n    <p:option name=\"schema\"/>\r\n    <p:input port=\"source\"/>\r\n    <p:output port=\"result\"/>    \r\n    <p:exec command=\"jing\"\r\n        source-is-xml=\"true\"\r\n        result-is-xml=\"false\"\r\n        wrap-result-lines=\"true\"\r\n        arg-separator=\",\"> \r\n        <p:with-option name=\"args\" select=\"$schema,' ',$input\"/>\r\n    </p:exec>\r\n</p:declare-step>\r\n\r\n```\r\n\r\nI execute the step on the command line as follows:\r\n\r\n```\r\n\r\ncalabash test-validate.xpl schema=xhtml-basic.rng input=test.html\r\n\r\n```\r\n\r\nThis leads to this output:\r\n\r\n```\r\n\r\nLoading catalog: file:/usr/share/xml/catalog.xml\r\nResolved URI: test-validate.xpl\r\n\tfile:/Users/Martin/workspace/epubcheck-xproc/xproc/test-validate.xpl\r\n<c:result xmlns:c=\"http://www.w3.org/ns/xproc-step\"><c:line>fatal: file not found: xhtml-basic.rng test.html (No such file or directory)</c:line>\r\n</c:result>\r\n```\r\n\r\nJing complains that the files cannot be found. Ironically, I do not get this error message when I execute Jing directly over the command line:\r\n\r\n```\r\njing xhtml-basic.rng test.html\r\n/Users/Martin/workspace/test.html:10:53: error: attribute \"style\" not allowed here; expected attribute \"id\", \"title\" or \"xml:lang\"\r\n...\r\n```\r\nWhen I pass the variables as args without whitespace, then calabash pass the parameters to Jing without any whitespace which leads to the same file-not-found error. Also invoking jing with\r\n\r\n```\r\n<p:exec command=\"java\"\r\n        source-is-xml=\"true\"\r\n        result-is-xml=\"false\"\r\n        wrap-result-lines=\"true\"\r\n        arg-separator=\",\">\r\n        <p:with-option name=\"args\" select=\"concat('-jar ../calabash/lib/jing.jar', ' ', $schema, ' ', $input)\"/>\r\n    </p:exec>\r\n```\r\n\r\nleads to an similar error message by the java virtual machine:\r\n\r\n```\r\nUnrecognized option: -jar ../calabash/lib/jing.jar ../rng/xhtml-basic.rng test.html\r\nCould not create the Java virtual machine.\r\n```\r\nI used Calabash 0.9.34\r\n","html_url":"https://github.com/ndw/xmlcalabash1/issues/9","title":"p:exec misinterprets argument with variables","number":9,"id":1763956,"created_at":"2011-09-28T12:41:58Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/30607760e41ef676103479754e03c99a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"30607760e41ef676103479754e03c99a","url":"https://api.github.com/users/mkraetke","login":"mkraetke","id":983392},"updated_at":"2011-10-27T15:19:45Z","url":"https://api.github.com/repos/ndw/xmlcalabash1/issues/comments/2544815","body":"Thank you, your example worked well for me. Unfortunately this method depends on the execution of an external validator, which makes the code hardly portable. Since the ```p:catch``` step consists of an readable error port, I bind them with ```p:pipe``` to my output to get the ```c:error```-messages. Here is my simple validation pipeline:\r\n\r\n\r\n```\r\n<p:declare-step xmlns:p=\"http://www.w3.org/ns/xproc\" version=\"1.0\">\r\n    <p:input port=\"source\">\r\n        <p:document href=\"schematron.xpl\"/>\r\n    </p:input>\r\n    <p:output port=\"result\"/>\r\n    <p:try name=\"try\">\r\n        <p:group>\r\n            <p:validate-with-relax-ng name=\"validateRelaxNG\" assert-valid=\"true\">\r\n                <p:input port=\"schema\">\r\n                    <p:document href=\"xproc.rng\"/>\r\n                </p:input>\r\n            </p:validate-with-relax-ng>\r\n        </p:group>\r\n        <p:catch name=\"catch\">\r\n            <p:identity>\r\n                <p:input port=\"source\">\r\n                    <p:pipe step=\"catch\" port=\"error\" />\r\n                </p:input>\r\n            </p:identity>\r\n        </p:catch>\r\n    </p:try>\r\n</p:declare-step>\r\n\r\n```\r\n\r\nBut I think it would be more convenient if ```p:valdate-with-relaxng``` and ```p:valdate-with-xml-schema``` would also get an report port like the ```p:valdate-with-schematron``` step. This would make the code shorter and more readable.\r\n\r\n","id":2544815,"created_at":"2011-10-27T15:19:45Z"}}