Re: RDFa API - adding Namespace

On Sat, 09 Oct 2010 18:44:16 +0100
Nathan <nathan@webr3.org> wrote:

> foaf('name');

This is probably something that doesn't need to be done as part of the
API itself. Individual scripters or library/toolkit authors can very
easily implement something like that on top of the API.

	function prefixMapper (p)
	{
		return function (s) { return p+s; };
	}

	var foaf = prefixMapper('http://xmlns.com/foaf/0.1/');
	var dc   = prefixMapper('http://purl.org/dc/terms/');

	window.alert(foaf('name'));
	window.alert(dc('title'));

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Sunday, 10 October 2010 10:07:23 UTC