Re: [rdfaapi] Notes on TypedLiteralConverters

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 UTC