W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > June 2010

Re: [rdfaapi] Notes on TypedLiteralConverters

From: Ivan Herman <ivan@w3.org>
Date: Mon, 14 Jun 2010 13:04:29 +0200
Cc: RDFa WG <public-rdfa-wg@w3.org>
Message-Id: <9019DD70-2F87-48A3-B75E-7E1EF6334C0B@w3.org>
To: Mark Birbeck <mark.birbeck@webbackplane.com>

On Jun 12, 2010, at 20:00 , Mark Birbeck wrote:

> A TypedLiteralConverter is an object that is passed to the
> DataContext.registerTypeConversion() method:
> 
>  <http://www.w3.org/TR/2010/WD-rdfa-api-20100608/#idl-def-TypedLiteralConverter>
> 
> Once registered the object will be given the opportunity to convert
> data-types to a native form. Here are some comments on this part of
> the API:
> 
> 1. We should allow languages to simply point to a function rather than
> always requiring an object with a function.
> 
> When specifying DOM event handlers in a browser, the parameter can be
> either an object that has the required method, or a function. If we
> allowed this shorthand in RDFa API, then an example would look like
> this:
> 
>  var context = document.data.context;
> 
>  context.registerTypeConversion(
>    "xsd:integer",
>    function (value) {
>      return parseInt(value, 10);
>    }
>  );
> 
> (The example is approximate -- see next point.)
> 

Thank you!:-)

I always felt uneasy with too many of these interfaces; it makes the usage very convoluted. I wish there was a possibility to define a function type in WebIDL (which I believe is not the case)... 

Ivan

----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf







Received on Monday, 14 June 2010 11:02:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:06 GMT