Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Dave Benjamin <dave@ramenlabs.com>
To: caml-list@inria.fr
Cc: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
Subject: Re: [Caml-list] ANN: XmlRpc-Light 0.4 - Now a server too
Date: Sun, 19 Aug 2007 11:29:03 -0700	[thread overview]
Message-ID: <46C88BEF.4070400@ramenlabs.com> (raw)
In-Reply-To: <912A68A9-3C5A-44FC-B563-4033E4EE6235@epfl.ch>

Daniel Bünzli wrote:
> Le 30 juil. 07 à 01:09, Dave Benjamin a écrit :
>> I really wish Winer had considered alternatives to ISO 8601--say, UTC 
>> epoch seconds--in the design of XML-RPC, because it's barely a 
>> standard at all! There are so many variations and options that writing 
>> a parser for it borders on natural language processing. Even the W3C 
>> suggestion, which restricts ISO 8601 to a very small subset, doesn't 
>> help here since it still conflicts with the common usage in XML-RPC, 
>> with hyphens omitted between the date values.
> 
> Very unfortunate. He should have at least used RFC 3339 [1], which is 
> akin to the W3C NOTE-datetime suggestion but a little more formal.

Even worse, despite the fact that the tag name is "dateTime.iso8601", 
the XML-RPC "specification" only allows one official format:

YYYYMMDDTHH:MM:SS

The wording is vague, but it's clarified here:
http://www.effbot.org/zone/xmlrpc-errata.htm

"The time value is “naive time”, and does not include a timezone. You 
can either use a fixed timezone in your application (such as UTC), or 
ship the timezone offset as a separate value."

In other words, even though ISO 8601 clearly indicates *several* ways of 
specifying a timezone, none are allowed by a standards conforming 
XML-RPC library. As many have pointed out, a date-time value with no 
time zone is useless, and assuming every server is using UTC is really 
just wishful thinking.

In XmlRpc-Light, the default implementation reads and writes the format:

YYYYMMDDTHH:MM:SS+TZ:TZ

with the time zone offset optional on parsing, and mandatory on 
generation. This seems to work everywhere but Ruby, where there exists 
code to parse the time zone, but it apparently hasn't been tested in 
awhile because it's broken. It's simple to fix, and I submitted a bug 
report about it:

http://rubyforge.org/tracker/index.php?func=detail&aid=12677&group_id=426&atid=1698

So, now I'm faced with this dilemma:

Option A: Change XmlRpc-Light's default date-time handling to conform to 
the XML-RPC spec. Interoperability with Ruby will work by default, but 
time zone offsets will all be zero unless the programmer provides an 
alternate, fancier date-time encoder/decoder.

Option B: Leave it alone. Time zone offsets will continue to work by 
default. Ruby interoperability will not work without a code change on 
one side or the other, at least until (and if) the Ruby team applies my 
patch. Existing Ruby installations will be broken. XmlRpc-Light will be 
considered non-conforming.

> I point you to this RFC because appendix A contains a tentative ABNF 
> definition of ISO 8601 you may be interested in looking at.
> [1] http://www.ietf.org/rfc/rfc3339.txt

Thanks for the pointer. It's nice to see this explained so formally. 
Maybe now would be a good time for me to learn how to use ocamllex.

Regards,
Dave


      parent reply	other threads:[~2007-08-19 18:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-29 17:51 Dave Benjamin
     [not found] ` <20070729211615.GA25630@furbychan.cocan.org>
2007-07-29 23:09   ` [Caml-list] " Dave Benjamin
     [not found]     ` <912A68A9-3C5A-44FC-B563-4033E4EE6235@epfl.ch>
2007-08-19 18:29       ` Dave Benjamin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C88BEF.4070400@ramenlabs.com \
    --to=dave@ramenlabs.com \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@epfl.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox