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

Re: Remarques on W3C Editor's Draft 13 November 2007

From: Norman Walsh <ndw@nwalsh.com>
Date: Wed, 28 Nov 2007 08:23:33 -0500
To: public-xml-processing-model-wg@w3.org
Message-ID: <m27ik24i7e.fsf@nwalsh.com>
/ Innovimax SARL <innovimax@gmail.com> was heard to say:
| Ok that's why I ask for a use case (a may be more than one) to explain
| where we need to generate UUID in an element ?

Here's one:

<p:pipeline name="main" type="px:mojo-sms"
	    xmlns:p="http://www.w3.org/ns/xproc"
	    xmlns:c="http://www.w3.org/ns/xproc-step"
	    xmlns:px="http://xproc.org/ns/xproc/ex">
  <p:option name="secret"   required="yes"/>
  <p:option name="to"       required="yes"/>
  <p:option name="text"     required="yes"/>
  <p:option name="username" required="yes"/>
  <p:output port="result"/>

  <px:uuid name="uuid"/>

  <p:group>
    <p:output port="result"/>

    <p:option name="_gadgetkey" value="55c3c57605f377bb3232eb55b04d56f50e897e3b"/>
    <p:option name="_name" select=".">
      <p:pipe step="uuid" port="result"/>
    </p:option>

    <p:group>
      <p:output port="result"/>

      <px:sha1 name="hash">
	<p:option name="value"
		  select="concat($username,':',$_gadgetkey,':',$_name,':',$secret)"/>
      </px:sha1>

      <p:group>
	<p:output port="result"/>

	<p:option name="_digest" select=".">
	  <p:pipe step="hash" port="result"/>
	</p:option>

	<px:form-url-encode name="body">
	  <p:parameter name="name" select="$_name"/>
	  <p:parameter name="recipient" select="$to"/>
	  <p:parameter name="text" select="$text"/>
	  <p:parameter name="gadgetkey" select="$_gadgetkey"/>
	  <p:parameter name="username" select="$username"/>
	  <p:parameter name="digest" select="$_digest"/>
	</px:form-url-encode>

	<p:replace name="repl" match="c:body">
	  <p:input port="source">
	    <p:inline>
	      <c:http-request method="post"
			      href="http://mojo.treeho.us/messages"
			      detailed="false">
		<c:body/>
	      </c:http-request>
	    </p:inline>
	  </p:input>
	</p:replace>

	<p:http-request/>
      </p:group>
    </p:group>
  </p:group>
</p:pipeline>

See http://norman.walsh.name/2007/10/18/mojo 

I expect there are going to be other services that require globally
unique identifiers and one easy way to generate them is with a UUID.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Society is immoral and immortal; it can
http://nwalsh.com/            | afford to commit any kind of folly, and
                              | indulge in any kind of vice; it cannot
                              | be killed, and the fragments that
                              | survive can always laugh at the
                              | dead.--Henry Adams

Received on Wednesday, 28 November 2007 13:23:51 GMT

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