- From: David Priest <docs@davidpriest.ca>
- Date: Tue, 21 Sep 2010 13:11:58 -0700
- To: xproc-dev@w3.org
I'm working toward a solution based on list responses. It appears to almost work: there is an error caused by the loaded config file; after I'm done with extracting its auth elements, I need to dump it (but can't figure out how to do that). Other than that, Calabash's output seems to indicate that it has successfully populated the variables, created attributes, and built the c:request. The reason for using auth.xml: this is going into an automated build process. The process that will call this is unknown to me; could be Ant, could be command line, could be a Windows batch script. The more it can stand alone, the better. A one-time config file edit is more trustworthy, IMO. command: calabash fetch.xpl query="version.xml" auth.xml: <?xml version="1.0"?> <config name="server"> <uri>https://192.168.56.101/</uri> <username>admin</username> <password>password</password> </config> fetch.xpl: <?xml version="1.0"?> <!-- - log into server - issue query - return document --> <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" name="fetch" version="1.0"> <p:output port="result"/> <p:input port="parameters" kind="parameter"/> <p:option name="query" required="true"/> <!-- load login details --> <p:load href="auth.xml"/> <!-- create a request template --> <p:group name="request"> <p:variable name="uri" select="//uri"/> <p:variable name="username" select="//username"/> <p:variable name="password" select="//password"/> <p:wrap wrapper="c:request" match="/"/> <p:add-attribute match="c:request" attribute-name="href"> <p:with-option name="attribute-value" select="concat($uri, $query)"/> </p:add-attribute> <p:add-attribute match="c:request" attribute-name="username"> <p:with-option name="attribute-value" select="$username"/> </p:add-attribute> <p:add-attribute match="c:request" attribute-name="password"> <p:with-option name="attribute-value" select="$password"/> </p:add-attribute> </p:group> <p:set-attributes match="/c:request"> <p:input port="attributes"> <p:inline> <c:request method="put" auth-method="Basic" send-authorization="true"/> </p:inline> </p:input> </p:set-attributes> <!-- send it via http-request --> <p:http-request/> </p:declare-step>
Received on Tuesday, 21 September 2010 20:12:28 UTC