W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > May 2007

p:http-request

From: Norman Walsh <ndw@nwalsh.com>
Date: Wed, 16 May 2007 09:36:53 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <87hcqczy8a.fsf@nwalsh.com>
I appreciate the power of the c:http-request (can we rename this
c:request so that it's less confusing with *p*:http-request?), but
I think it's awfully heavyweight for the simple case.

Consider the earlier example in the spec:

<p:http-request>
  <p:input port="source">
    <p:inline>
      <c:http-request method="post" href="http://example.com/form-action">
        <c:entity-body content-type="application/x-www-form-urlencoded">
          <c:body>name=W3C&amp;spec=XProc</c:body>
        </c:entity-body>
      </c:http-request>
    </p:inline>
  </p:input>
</p:http-request>

I think that'd be a lot easier for users to understand if it was written
like this:

<p:http-request>
  <p:option name="method" value="post"/>
  <p:option name="href" value="http://example.com/form-action"/>
  <p:option name="content-type" value="application/x-www-form-urlencoded"/>
  <p:input port="source">
    <p:inline>
      <c:body>name=W3C&amp;spec=XProc</c:body>
    </p:inline>
  </p:input>
</p:http-request>

I suggest the following changes:

1. Make the method, href, status-only, and override-content-type values
   of c:http-request options on the p:http-request step.

2. Make content-type an option on c:http-request

3. Make the behavior of the step dependent on what arrives on the input
   port:

   * If a c:body arrives, use it (and the options specified per 1)
   * If a c:http-request arrives, use it (with the options specified per 1
     serving as overrides for the values specified as attributes).
   * If a single document with some other root element arrives, treat it
     as a single body
   * If a sequence arrives, treat it as multipart.

4. Rename c:http-request to c:request

5. Rename c:http-response to c:response

I think this simplifies things in the simple case without sacrificing
any functionality in the more complex cases.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Everything should be made as simple as
http://nwalsh.com/            | possible, but no simpler.

Received on Wednesday, 16 May 2007 13:37:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:51 GMT