W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2010

Re: Newbie: config file import, and http-request

From: Florent Georges <fgeorges@fgeorges.org>
Date: Tue, 21 Sep 2010 11:30:51 +0100
Message-ID: <AANLkTi=7JyBur90CYJ7D=iDbs0RK9PzMn3QN35k360QK@mail.gmail.com>
To: David Priest <david@davidpriest.ca>
Cc: xproc-dev@w3.org
On 20 September 2010 23:05, David Priest wrote:


> I'm beginning to experiment with replacing Ant with XProc.  One
> of my key items involves accessing an HTTPS server.  Of course,
> I don't want my credential details getting into the repository,
> so I would like to have a config file that provides username
> and password.

  You can use p:add-attribute:

<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"

   <p:input port="source">
         <c:request method="get" detailed="true" auth-method="basic"/>
   <p:output port="result"/>

   <p:parameters name="params">
      <p:input port="parameters">
         <p:document href="dpriest.xml"/>

   <p:add-attribute match="/c:request" attribute-name="username">
      <p:input port="source">
         <p:pipe port="source" step="mir.fetch"/>
      <p:with-option name="attribute-value" select="
          /c:param-set/c:param[@name eq 'username']/@value">
         <p:pipe port="result" step="params"/>

   <p:add-attribute match="/c:request" attribute-name="password">
      <p:with-option name="attribute-value" select="
          /c:param-set/c:param[@name eq 'password']/@value">
         <p:pipe port="result" step="params"/>

   <p:add-attribute match="/c:request" attribute-name="href">
      <p:with-option name="attribute-value" select="
          concat(/c:param-set/c:param[@name eq 'uri']/@value, 'version.xml')">
         <p:pipe port="result" step="params"/>

   <!-- commented out to see the c:request element instead -->


  I used to use options for that exact same purpose[1], but using
a file can be interesting in some cases.


Florent Georges

Received on Tuesday, 21 September 2010 10:31:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:54 UTC